主题定制 cli 工具(tinper-bee-theme-cli)

介绍

       tinper-bee-theme-cli 工具结合tinper-bee实现主题定制功能的cli工具,原理为cli工具在本地生成一个themeColor.json文件,然后通过文件进行在线构建组件库,生成一个自己编写的tinper-bee.css,提供CDN地址,供下载和link引用。

安装、使用

  1. $ npm install tinper-bee-theme-cli -g
  2. $ mkdir theme && cd theme
  3. $ tinper-theme init

会在当前目录下生成一个themeColor.json文件,然后修改各项色值(变量注解如下),并且保存。

  1. $ tinper-theme build

会提示你输入版本号,回车 等待一段时间后,会出现打包后的css的连接(目前css文件会托管到cdn上)通过连接下载。

目前只有tinper-bee@2.0.0以上的版本才支持主题定制。 稍等片刻安装结束后,会输出CDN地址为打包成功!

api

项目根目录,使用以下命令完成对应功能。

命令5会有一分钟的延时,请耐心等待。

# Scripts 脚本命令 Description 功能描述
1 tinper-theme h api 查询
2 tinper-theme v 版本查询
3 tinper-theme init 生成主题自定的必要文件
4 tinper-theme build 打包编译生成自定义的css文件

tinper-bee 主题样式文件注解(themeColor.json)

一下所有的色值均为rgba格式的数值

  1. /* 全局样式 */
  2. $default-color // 默认色
  3. $primary-color // 主题色
  4. $font-family-primary // 字体
  5. $font-size-base // 字号
  6. $text-color-base // 字体颜色
  7. $border-color // 边框色
  8. $item-hover-bg-color-base //条目hover背景色
  9. $item-selected-bg-color-base //条目selected背景色
  10. /* 按钮细化样式 */
  11. $secondary-color // 次按钮背景色
  12. $button-secondary-text-color // 次按钮字体色
  13. /*表格细化样式*/
  14. $table-header-background-color // 表头背景色
  15. $table-header-text-color // 表头文字颜色
  16. $table-border-color-base // 表格分割线颜色

help

  1. $ tinper-theme
  2. Usage :
  3. 1. tinper-theme init themeColor.json file has been created, please modify the theme file
  4. 2. tinper-theme h Help
  5. 3. tinper-theme v Version
  6. 4. tinper-theme build build tinper scss file

联系我们 [问题反馈]