/
_icon-button-theme.scss
82 lines (72 loc) · 3.08 KB
/
_icon-button-theme.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@use '@material/icon-button/mixins' as mdc-icon-button;
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
@use '../mdc-helpers/mdc-helpers';
@use '../../material/core/theming/theming';
@use '../../material/core/typography/typography';
@use './button-theme-private';
@mixin color($config-or-theme) {
$config: theming.get-color-config($config-or-theme);
@include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-icon-button {
@include mdc-ripple-theme.states(
$query: mdc-helpers.$mat-theme-styles-query,
$ripple-target: button-theme-private.$button-state-target);
&.mat-primary {
@include mdc-ripple-theme.states-base-color(primary,
$query: mdc-helpers.$mat-theme-styles-query,
$ripple-target: button-theme-private.$button-state-target);
@include mdc-icon-button.ink-color(primary, $query: mdc-helpers.$mat-theme-styles-query);
@include button-theme-private.ripple-ink-color(primary);
}
&.mat-accent {
@include mdc-ripple-theme.states-base-color(secondary,
$query: mdc-helpers.$mat-theme-styles-query,
$ripple-target: button-theme-private.$button-state-target);
@include mdc-icon-button.ink-color(secondary, $query: mdc-helpers.$mat-theme-styles-query);
@include button-theme-private.ripple-ink-color(secondary);
}
&.mat-warn {
@include mdc-ripple-theme.states-base-color(error,
$query: mdc-helpers.$mat-theme-styles-query,
$ripple-target: button-theme-private.$button-state-target);
@include mdc-icon-button.ink-color(error, $query: mdc-helpers.$mat-theme-styles-query);
@include button-theme-private.ripple-ink-color(error);
}
@include button-theme-private.apply-disabled-style() {
@include button-theme-private.apply-disabled-color();
}
}
@include mdc-icon-button.without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
}
@mixin typography($config-or-theme) {
$config: typography.private-typography-to-2018-config(
theming.get-typography-config($config-or-theme));
@include mdc-helpers.mat-using-mdc-typography($config) {
@include mdc-icon-button.without-ripple($query: mdc-helpers.$mat-typography-styles-query);
}
}
@mixin density($config-or-theme) {
$density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-icon-button {
@include mdc-icon-button.density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
@include button-theme-private.touch-target-density($density-scale);
}
}
@mixin theme($theme-or-color-config) {
$theme: theming.private-legacy-get-theme($theme-or-color-config);
@include theming.private-check-duplicate-theme-styles($theme, 'mat-mdc-icon-button') {
$color: theming.get-color-config($theme);
$density: theming.get-density-config($theme);
$typography: theming.get-typography-config($theme);
@if $color != null {
@include color($color);
}
@if $density != null {
@include density($density);
}
@if $typography != null {
@include typography($typography);
}
}
}