How do I customize Angular Material's input/md-input-container component?

后端 未结 4 540
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 11:06

As stated in the title, how do I customize these elements? It seems they are using transparent background which is very difficult to view on most background palettes

4条回答
  •  离开以前
    2021-02-05 11:40

    I would recommend to use the palette configuration:

        app.config(function($mdThemingProvider) {
    
            //change default color for primary
            var indigo = $mdThemingProvider.extendPalette('indigo', {
                '500': '569fd4'
            });
            $mdThemingProvider.definePalette('indigo', indigo);
    
            //change default color for warn
            var indigo = $mdThemingProvider.extendPalette('red', {
                '500': 'ff5800'
            });
            $mdThemingProvider.definePalette('red', indigo);
    
            $mdThemingProvider.theme('default').primaryPalette('indigo').warnPalette('red');  
    
            //here you change placeholder/foreground color.
            $mdThemingProvider.theme('default').foregroundPalette[3] = "rgba(0,0,0,0.67)";
    
    });
    

    Source: How to set light foreground colors for text when using dark theme?

提交回复
热议问题