Angular4 Change md-button's ripple color

a 夏天 提交于 2020-01-01 09:35:35

问题


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?


回答1:


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);
  }
}


来源:https://stackoverflow.com/questions/46385399/angular4-change-md-buttons-ripple-color

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!