Changing theme colors of Material Design Lite in scss

限于喜欢 提交于 2019-12-22 12:25:40

问题


I installed material design lite module through npm, but I want to change it with other colors and preferably with colors that are not included in Material Design Color Pallete.

I read here Here on GitHub how to do it.

But it doesn't work for me, when I try to change color I get white/black color look.

I have in my main scss

@import 'colors';
@import '../../../node_modules/material-design-lite/src/material-design-lite'; `

And my _colors.scss contains:

$golden: #c6a259;
$brown: #240000;
$color-primary: #c6a259 !default;
$color-primary-dark: #c6a259 !default;
$color-accent: #240000 !default;
$color-primary-contrast: #240000 !default;
$color-accent-contrast: #240000 !default;

The difference you can see in image below (Before and after I changed values of color varaibles).


回答1:


Start with looking at the generated CSS.

Try to remove the !default.

And use RGB color string:"255, 0, 0"

For example for red as primary color.

 $color-primary: "255, 0, 0";


来源:https://stackoverflow.com/questions/36980934/changing-theme-colors-of-material-design-lite-in-scss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!