npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

colorui-theme

v1.0.14

Published

这个从 ColorUi 生成不同颜色主题的工具

Downloads

34

Readme

colorui-theme

这个是从ColorUi生成不同颜色主题的工具.
ColorUi是款优秀的 css 框架, 在此非常感谢 weilanwl 将它开源.
关于ColorUi更多信息,请前往 https://github.com/weilanwl/ColorUIhttps://www.color-ui.com

功能

  • ColorUi中不颜色映射成多组主题.
  • 轻松的为ColorUi增加或替换颜色规则.
  • 按模块导出的main-lite.css,减少 css 文件大小

TODO

  • 通过uncss过滤没用的css规则

使用方法

npm install colorui-theme  -g
或
npm install colorui-theme  --save-dev

cutheme ./config.json

配置文件

可以为 .js.json 文件

//config.js
{
  // 指定 colorui 中 main.css 所在的目录
  src:'~/colorui',
  // 指定生成文件保存的目录
  dest:'~/projectDir/css',

  // src下的main.css 会导出一份到 dest中,如果指定 newColors 会在文件末尾追加新的颜色规则
  // 如果 fileName === false 则不会导出该文件, 其他空值默认 'main-new.css'
  fileName:'main-new.css',
  //需要从 src 目录拷贝到 dest 的文件, 默认包含: icon.css, animation.css
  copyFiles:['icon.css', 'animation.css'],
  //是否追加 hover 规则
  addHoverRules:true,
  //指定需要添加的新颜色
  newColors:[{
    name:'newblue', //新颜色的名字
    main: '#0081ff',  //主色
    inverse: '#ffffff',  //反色
    light: '#cce6ff',   //亮色
    shadow: 'rgba(0, 102, 204, 0.2);',//阴影色
    gradual: '#1cbbb4',//渐变色 也可以指定两个颜色 如: ['#0081ff', '#1cbbb4']
    lightInverse:'#0081ff', //亮色的反色, 默认与 main 相同
    hover:'',//默认通过计算 main 加深
    lightHover:'',//默认通过计算 light 加深
  }],


  //多主题配置
  themes:{
    // 合并所有 theme 文件到同一个文件
    // 如果 fileName === false 则不会导出该文件, 其他空值默认 'themes.css'
    fileName:'themes.css',
    //颜色值 如果 fileName === false 则不会导出该文件, 其他空值默认 'colors.json'
    jsonFileName: false,
    themes:[{
      //主题名称 默认:'default'
      name:'default',
      // 如果 fileName === false 则不会导出该文件, 其他空值默认`theme-${name}.css`
      fileName:'cutheme-default.css',
      // 如果 fileName === false 则不会导出该文件, 其他空值默认 `${name}-colors.json`
      jsonFileName: false,
      //每个选择器追加的命名空间, 默认为`.theme-${name} ` 注意:通常后面有空格
      namespace:'.theme-default ',
      //指定主题中每种元素映射 colorui 中颜, 也可指定 newColors 中的颜色
      colorMap:{
        'activated':'blue',
        'disabled':'grey',
        'newColor':'newblue',//newColors 中的颜色
      },
    },
    //... 更多主题
    ],
  },


   //根据指定模块来导出 css
  lite:{
    // 如果 fileName === false 则不会导出该文件, 其他空值默认 `main-lite.css`
    fileName:'main-lite.css',
   //指定的modules 是删除 还是保留模式, 默认删除模式
    isRemove:true
    //自带模块
    modules:[
      'color', //删除 color 模块
      '^color-red', //保留 color-red. 子模块可以使用 ^ 运算符合
      'chat',//删除 chat 模块
    ],
  }
}

模块

中间有 "-" 的为子模块

comment
image
switch
switch-switch
switch-checkbox
switch-radio
border
button
tag
avatar
progress
load
list
bar
nav
chat
card
form
modal
swiper
steps
timeline
layout
layout-flex
layout-grid
layout-margin
layout-padding
layout-float
text
color
color-red
color-orange
color-yellow
color-olive
color-green
color-cyan
color-blue
color-purple
color-mauve
color-pink
color-brown
color-grey
color-gray
color-black
color-white