jd-opensource / jd-opensource/taro-ui
自定义主题颜色不生效
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
**问题描述**
我使用官网的主题生成器生成了一个绿色主题,把scss样式和文件按照文档引用进去,首页和里面页面的按钮颜色都是蓝色不生效,另外一个“我的”页面却是可以的。
研究两天了,也看过issue了,项目和微信开发者工具都重启过了,也不行,用的版本都是挺新的。

**复现步骤**
app.js
```tsx
...
import './custom-variables.scss';
import './app.scss';
...
```
custom-variables.scss
```scss
/* Custom Theme */
$color-brand: #00b38a;
$color-brand-light: #40c6a7;
$color-brand-dark: #008f6e;
@import "~taro-ui/dist/style/index.scss";
```
app.scss
```scss
/* reset */
image {
max-width: 100%;
}
/* page */
page {
background-color: #f6f6f6;
padding: .512rem 0;
}
.container {
padding: 0 1rem;
}
```
**期望行为**
蓝色按钮都变为绿色。
**报错信息**


“首页”还有“编辑“和”查看“页面进去的按钮都是蓝色的,就“我的”页面按钮是绿色的。
**系统信息**
👽 Taro v1.3.22
Taro CLI 1.3.22 environment info:
System:
OS: macOS 10.15.1
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 9.6.0 - ~/.nvm/versions/node/v9.6.0/bin/node
npm: 5.6.0 - ~/.nvm/versions/node/v9.6.0/bin/npm
npmPackages:
@tarojs/async-await: ^1.3.20 => 1.3.20
@tarojs/components: 1.3.20 => 1.3.20
@tarojs/plugin-babel: 1.3.20 => 1.3.20
@tarojs/plugin-csso: 1.3.20 => 1.3.20
@tarojs/plugin-sass: 1.3.20 => 1.3.20
@tarojs/plugin-uglifyjs: 1.3.20 => 1.3.20
@tarojs/redux: ^1.3.20 => 1.3.20
@tarojs/redux-h5: ^1.3.20 => 1.3.20
@tarojs/router: 1.3.20 => 1.3.20
@tarojs/taro: 1.3.20 => 1.3.20
@tarojs/taro-alipay: 1.3.20 => 1.3.20
@tarojs/taro-h5: 1.3.20 => 1.3.20
@tarojs/taro-qq: 1.3.20 => 1.3.20
@tarojs/taro-quickapp: 1.3.20 => 1.3.20
@tarojs/taro-swan: 1.3.20 => 1.3.20
@tarojs/taro-tt: 1.3.20 => 1.3.20
@tarojs/taro-weapp: 1.3.20 => 1.3.20
@tarojs/webpack-runner: 1.3.20 => 1.3.20
eslint-config-taro: 1.3.20 => 1.3.20
eslint-plugin-taro: 1.3.20 => 1.3.20
nerv-devtools: ^1.5.0 => 1.5.0
nervjs: ^1.5.1 => 1.5.1
stylelint-config-taro-rn: 1.3.20 => 1.3.20
stylelint-taro-rn: 1.3.20 => 1.3.20
- Taro 版本:1.3.20
- Taro UI 版本:2.2.3
- 报错平台:微信小程序
**补充信息**
暂无。
Contributor guide
Assessment
This issue has not been assessed yet.