如何自定义 Angular Material 的 input/md-input-container 组件? [英] How do I customize Angular Material's input/md-input-container component?

查看:30
本文介绍了如何自定义 Angular Material 的 input/md-input-container 组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如标题所述,如何自定义这些元素?似乎他们正在使用透明背景,这在大多数背景调色板上很难查看

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

推荐答案

在angular-material.css"之后添加一个空白 css 文件,并在该空白 css 文件中覆盖您要自定义的规则.

Add one blank css file after "angular-material.css" and inside that blank css file overwrite the rules you want to customize.

针对您面临的问题,我在 custom.css 中添加了以下规则.

For the problem you are facing I added the following rules in my custom.css.

md-input-container.md-default-theme label, 
 md-input-container.md-default-theme .md-placeholder{
    color:grey !important;
}

在这里,您可以根据需要更改 colorbackground-color.

Here you could change color or background-color as you like.

这篇关于如何自定义 Angular Material 的 input/md-input-container 组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆