如何通过定义自己的自定义调色板来更改工具栏的文本颜色?或一般而言,如何设置文字的颜色?
app.config(function($mdThemingProvider) {
$mdThemingProvider.definePalette('accent', {
'50': '#FFEB3B',
'100': '#FFEB3B',
'200': '#FFEB3B',
'300': '#FFEB3B',
'400': '#FFEB3B',
'500': '#FFEB3B',
'600': '#FFEB3B',
'700': '#FFEB3B',
'800': '#FFEB3B',
'900': '#FFEB3B',
'A100': '#FFEB3B',
'A200': '#FFEB3B',
'A400': '#FFEB3B',
'A700': '#FFEB3B',
'contrastDefaultColor': 'dark', // whether, by default, text (contrast)
// on this palette should be dark or light
'contrastDarkColors': ['50', '100', //hues which contrast should be 'dark' by default
'200', '300', '400', 'A100'],
'contrastLightColors': undefined
});
$mdThemingProvider.definePalette('primary', {
'50': '#FFEB3B',
'100': '000000',
'200': '000000',
'300': '000000',
'400': '#FFEB3B',
'500': '000000',
'600': '000000',
'700': '000000',
'800': '000000',
'900': '#FFEB3B',
'A100': '#FFFFFF',
'A200': '000000',
'A400': '000000',
'A700': '#FFEB3B',
'contrastDefaultColor': 'light', // whether, by default, text (contrast)
// on this palette should be dark or light
'contrastDarkColors': ['50', '100', //hues which contrast should be 'dark' by default
'200', '300', '400', 'A100'],
'contrastLightColors': []
});
$mdThemingProvider.theme('default')
.primaryPalette('primary')
.accentPalette('accent');
});
[属性对比DefaultColor属性控制工具栏中文本的颜色,但是只能将其设置为'浅色'或'深色',因此它将是白色或黑色,但我希望它是黄色。
我的猜测是,您必须定义自己的CSS规则,例如:
md-tabs > ..> md-tab-item {
color: yellow;
}