【发布时间】:2019-05-02 17:27:14
【问题描述】:
我想在使用 Angular 7 和材料设计显示的列表上设置悬停颜色。由于$primary、$accent 和$warn 颜色不能很好地达到此目的,因此我希望获得与悬停按钮时相同的悬停颜色。我目前使用的是material design multiple-themes example的candy-app-theme和dark-theme,所以我自己没有定义这个颜色。
为了定义我的悬停颜色,我需要查询此按钮悬停颜色。因此:如何查询这个颜色?
@mixin options-component-theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);// Use mat-color to extract individual colors from a palette as necessary.
//i have tried these two:
$hover: map-get($theme, hover);
$focused-button: map-get($theme, focused-button);
$primary-color: mat-color($primary);
$accent-color: mat-color($accent);
.listItemFormat:hover {
background-color: $focused-button;
}
我尝试通过hover 和focused-button、as listed in this answer by TimTheEnchanter 获取颜色,但这不起作用(我最终没有任何可见的悬停效果)。
【问题讨论】:
标签: angular scss-mixins angular-material-7