我想在使用 Angular 7 和材料设计显示的列表上具有悬停颜色。由于$primary
,$accent
和$warn
颜色 不能很好地达到这个目的,我想获得与悬停时按钮相同的悬停颜色。我目前正在使用材料设计多主题示例中的 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
and获取颜色focused-button
,正如 TimTheEnchanter 在这个答案中列出的那样,但是这不起作用(我最终没有任何可见的悬停效果)。