Angular4 更改 md 按钮的波纹颜色 [英] Angular4 Change md-button's ripple color

查看:21
本文介绍了Angular4 更改 md 按钮的波纹颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Material for Angular4 在我的网页中创建了一个 md 按钮.有没有办法改变涟漪效果的颜色并使其变白?我还可以更改其他涟漪属性,例如涟漪效果的持续时间吗?

I have created a md-button in my webpage using Material for Angular4. Is there a way to change the ripple effect's color and make it white? Can I also change other ripple properties, like the duration of the ripple effect?

推荐答案

事实证明,为了改变涟漪属性,应该在 mat-ripple-theme 处创建一个 mixin 并将其导入他们应用程序的 style.scss文件:

It turned out that in order to change the ripple properties, one should create a mixin at the mat-ripple-theme and import it in their app's styles.scss file:

@import '~@angular/material/theming';

@mixin mat-ripple-theme($theme) {
  .mat-ripple-element {
    background-color: rgba(255, 255, 255, .4);
  }
}

这篇关于Angular4 更改 md 按钮的波纹颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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