-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Expand file tree
/
Copy path_chart-theme.scss
More file actions
82 lines (72 loc) · 2.55 KB
/
_chart-theme.scss
File metadata and controls
82 lines (72 loc) · 2.55 KB
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 '../core/theming/inspection';
@use '../core/tokens/token-utils';
@use '../core/typography/typography';
@use './m2-chart';
@use './m3-chart';
@use 'sass:map';
/// Outputs base theme styles for the mat-chart.
/// @param {Map} $theme The theme to generate base styles for.
@mixin base($theme) {
$tokens: map.get(m2-chart.get-tokens($theme), base);
@if inspection.get-theme-version($theme) == 1 {
$tokens: map.get(m3-chart.get-tokens($theme), base);
}
@include token-utils.values($tokens);
}
/// Outputs color theme styles for the mat-chart.
/// @param {Map} $theme The theme to generate color styles for.
/// @param {String} $color-variant The color variant to use.
@mixin color($theme, $color-variant: null) {
$tokens: map.get(m2-chart.get-tokens($theme), color);
@if inspection.get-theme-version($theme) == 1 {
$tokens: map.get(m3-chart.get-tokens($theme, $color-variant), color);
}
@include token-utils.values($tokens);
}
/// Outputs typography theme styles for the mat-chart.
/// @param {Map} $theme The theme to generate typography styles for.
@mixin typography($theme) {
$tokens: map.get(m2-chart.get-tokens($theme), typography);
@if inspection.get-theme-version($theme) == 1 {
$tokens: map.get(m3-chart.get-tokens($theme), typography);
}
@include token-utils.values($tokens);
}
/// Outputs density theme styles for the mat-chart.
/// @param {Map} $theme The theme to generate density styles for.
@mixin density($theme) {
$tokens: map.get(m2-chart.get-tokens($theme), density);
@if inspection.get-theme-version($theme) == 1 {
$tokens: map.get(m3-chart.get-tokens($theme), density);
}
@include token-utils.values($tokens);
}
/// Outputs the CSS variable values for the given tokens.
/// @param {Map} $tokens The token values to emit.
@mixin overrides($tokens: ()) {
@each $token, $value in $tokens {
--mat-chart-#{$token}: #{$value};
}
}
/// Outputs all theme styles for the mat-chart.
/// @param {Map} $theme The theme to generate styles for.
/// @param {String} $color-variant The color variant to use.
@mixin theme($theme, $color-variant: null) {
@if inspection.get-theme-version($theme) == 1 {
@include base($theme);
@include color($theme, $color-variant);
@include density($theme);
@include typography($theme);
} @else {
@include base($theme);
@if inspection.theme-has($theme, color) {
@include color($theme);
}
@if inspection.theme-has($theme, density) {
@include density($theme);
}
@if inspection.theme-has($theme, typography) {
@include typography($theme);
}
}
}