Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改主题色 #4

Open
ycshill opened this issue Feb 21, 2019 · 0 comments
Open

修改主题色 #4

ycshill opened this issue Feb 21, 2019 · 0 comments

Comments

@ycshill
Copy link
Contributor

ycshill commented Feb 21, 2019

第一步 下载vue-stone

https://github.com/jd-smart-fe/vue-stone 地址下载最新的 vue-stone;

第二步 找到修改主题色的样式文件

  • 找到 themes.cssvariables.css 文件,位置如下:
├── src  
     ├── styles   
        ├── default-theme
            ├── themes.css
            └── variables.css

第三步 修改主题色

  • themes.css 文件中,加入用到的主题色并提交,例如:
/* 智能灯主题色 */
$theme-9777fa: #9777fa;

tips:

  • 命名格式为 $theme-{16位色值}
  • variable.css 文件中,确保已经引入 theme.css 文件,并修改用到主题色的地方,如下:
/* 主题色-用于 vue-stone 组件: */
$main-color: $theme-9777fa;  // vue-stone 组件中用到的颜色
$c-primary: $theme-9777fa// vue-stone 组件中一部分组件用到的颜色
$c-primary-on: $theme-9777fa // 按钮等按住的时候颜色

/* 模板中使用主题色 */
.c-theme-color {
  color: $theme-9777fa;
}

第四步 打包文件

执行命令 npm run build 将文件打包

第五步 在项目中引入打包后的css 文件

  • 拷贝 dist 目录中的 vue-stone.css 文件,所在位置如下:
├── dist  
     ├── vue-stone.css
  • 将该文件拷贝到自己开发的项目中:
    • src 下新建一个 styles 文件夹;
    • vue-stone.css文件放入 styles 文件夹中;
  • 修改 main.js 文件:
// 注释以前一如的文件
// import 'vue-stone/dist/vue-stone.css';
// 加入本地文件
import '@/styles/style.css';

启动项目就可以了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant