Configuring a dark theme for Angular Material

I'm working on a design for my webapp, and I'd like a dark theme similar to that seen here.

Sadly I've found the Angular Material Theming Docs very hard to get my head around; no mention of where each colour will be used, how to set a background color or a text color etc.

I'm currently using:

.config(function($mdThemingProvider) {
    $mdThemingProvider.definePalette('coolpal', {"50":"#d9ddec","100":"#a6b1d2","200":"#8190bf","300":"#5468a5","400":"#495b90","500":"#252830","600":"#354168","700":"#2a3453","800":"#20283f","900":"#161b2b","A100":"#252830","A200":"#a6b1d2","A400":"#495b90","A700":"#2a3453"});
    $mdThemingProvider.definePalette('accentpal', {"50":"#ffffff","100":"#bfe7f7","200":"#8dd5f1","300":"#4ebee9","400":"#32b4e5","500":"#1ca8dd","600":"#1993c2","700":"#157fa7","800":"#126a8c","900":"#0e5570","A100":"#ffffff","A200":"#bfe7f7","A400":"#32b4e5","A700":"#157fa7"});
    $mdThemingProvider.definePalette('warnpal', {"50":"#f0fdf9","100":"#adf4dc","200":"#7bedc7","300":"#3ce5ac","400":"#21e1a0","500":"#1bc98e","600":"#17ae7b","700":"#149368","800":"#107855","900":"#0d5d42","A100":"#f0fdf9","A200":"#adf4dc","A400":"#21e1a0","A700":"#149368"});


    $mdThemingProvider.theme('default')
        .primaryPalette('coolpal').dark()
        .accentPalette('accentpal')
        .warnPalette('warnpal')
        .backgroundPalette('coolpal')
})

With a bit of hacking of colours this works ok, but if I look at the colors in an md-toolbar , the text is set to rgba(0,0,0,0.87); and I have no idea how to change it; I assumed it would come from somewhere in my coolpal theme, but it's not. Here's how my text elements are being styled:

角度材料mdtheming提供者的例子

How can I alter $mdThemingProvider to ensure the text is a light color rather than opaque black?


我会建议扩展一个现有的调色板,更容易..例如;

var myPalette = $mdThemingProvider.extendPalette('indigo', {
            '500': '183863'
        });
$mdThemingProvider.definePalette('mine', myPalette);
$mdThemingProvider.theme('default')
            .primaryPalette('mine').dark();
链接地址: http://www.djcxy.com/p/88510.html

上一篇: 由于外部库,Webpack构建速度很慢

下一篇: 配置角度材质的黑暗主题