-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_breadcrumb-theme.scss
More file actions
186 lines (165 loc) · 7.95 KB
/
Copy path_breadcrumb-theme.scss
File metadata and controls
186 lines (165 loc) · 7.95 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
@use 'sass:map';
@use '../../config';
@use '../../functions' as *;
@use '../../schemas/' as *;
@use '../../../utils/map' as *;
@use '../../../color/functions' as *;
@use '../../../elevations/' as *;
////
/// @package theming
/// @group themes
/// @access public
/// @author <a href="https://github.com/adrianptrv" target="_blank">Adrian Petrov</a>
////
/// Breadcrumb Theme
///
/// PRIMARY TOKENS:
/// - `$text-color` — The text color of the breadcrumb.
///
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
/// @param {Color} $text-color [null] - The text color of the breadcrumb.
/// @param {Color} $icon-color [null] - The color of the breadcrumb icon. Auto-derived from text-color.
/// @param {Color} $current-text-color [null] - The text color of the currently selected breadcrumb item.
/// @param {Color} $current-icon-color [null] - The icon color of the currently selected breadcrumb item.
/// @param {Color} $pressed-text-color [null] - The text color of the breadcrumb when pressed. Auto-derived from text-color.
/// @param {Color} $pressed-icon-color [null] - The color of the breadcrumb icon when pressed. Auto-derived from pressed-text-color.
/// @param {Color} $hover-text-color [null] - The text color of the breadcrumb when hovered. Auto-derived from text-color.
/// @param {Color} $hover-icon-color [null] - The color of the breadcrumb icon when hovered. Auto-derived from hover-text-color.
/// @param {Color} $focus-text-color [null] - The text color of the breadcrumb when focused. Auto-derived from text-color.
/// @param {Color} $focus-icon-color [null] - The color of the breadcrumb icon when focused. Auto-derived from focus-text-color.
/// @param {Color} $focus-underline-color [null]- The text underline color of the breadcrumb on focus. Auto-derived from focus-text-color. Only used in the Material theme.
/// @param {Color} $focus-border-color [null] - The focus border color.
/// @param {Color} $focus-hover-text-color [null] - The text color of the breadcrumb when focused and hovered. Auto-derived from hover-text-color.
/// @param {Color} $focus-hover-icon-color [null] - The color of the breadcrumb icon when focused and hovered. Auto-derived from focus-hover-text-color.
/// @param {Color} $focus-hover-underline-color [null]- The text underline color of the breadcrumb on focus and hover. Auto-derived from focus-hover-text-color. Only used in the Material theme.
/// @param {Color} $focus-pressed-text-color [null] - The text color of the breadcrumb when focused and pressed. Auto-derived from pressed-text-color.
/// @param {Color} $focus-pressed-icon-color [null] - The color of the breadcrumb icon when focused and pressed. Auto-derived from focus-pressed-text-color.
/// @param {Color} $focus-pressed-underline-color [null]- The text underline color of the breadcrumb on focus and pressed. Auto-derived from focus-pressed-text-color. Only used in the Material theme.
/// @param {Color} $disabled-text-color [null] - The text color of the breadcrumb when disabled.
/// @param {Color} $disabled-icon-color [null] - The color of the breadcrumb icon when disabled. Auto-derived from disabled-text-color.
/// @param {Color} $separator-color [null] - The color of the breadcrumb separator.
///
/// @requires $light-material-schema
///
/// @example scss - Change the text and icon color of the breadcrumb:
/// $my-breadcrumb-theme: breadcrumb-theme(
/// $text-color: magenta,
/// $icon-color: cyan
/// );
/// // Pass the theme to the css-vars mixin
/// @include tokens($my-breadcrumb-theme);
@function breadcrumb-theme(
$schema: $light-material-schema,
$text-color: null,
$icon-color: null,
$current-text-color: null,
$current-icon-color: null,
$hover-text-color: null,
$hover-icon-color: null,
$pressed-text-color: null,
$pressed-icon-color: null,
$focus-text-color: null,
$focus-icon-color: null,
$focus-underline-color: null,
$focus-border-color: null,
$focus-hover-text-color: null,
$focus-hover-icon-color: null,
$focus-hover-underline-color: null,
$focus-pressed-text-color: null,
$focus-pressed-icon-color: null,
$focus-pressed-underline-color: null,
$disabled-text-color: null,
$disabled-icon-color: null,
$separator-color: null
) {
$selector: #{config.element-prefix() + '-' + 'breadcrumb'};
$breadcrumb-schema: ();
@if map.has-key($schema, 'breadcrumb') {
$breadcrumb-schema: map.get($schema, 'breadcrumb');
} @else {
$breadcrumb-schema: $schema;
}
$theme: digest-schema($breadcrumb-schema);
$variant: map.get($theme, '_meta', 'theme');
@if not($icon-color) and $text-color {
$icon-color: var(--text-color);
}
@if not($current-icon-color) and $current-text-color {
$current-icon-color: var(--current-text-color);
}
@if not($hover-text-color) and $text-color {
$hover-text-color: dynamic-shade(var(--text-color));
}
@if not($hover-icon-color) and $hover-text-color {
$hover-icon-color: var(--hover-text-color);
}
@if not($pressed-text-color) and $text-color {
$pressed-text-color: dynamic-shade(var(--text-color));
}
@if not($pressed-icon-color) and $pressed-text-color {
$pressed-icon-color: var(--pressed-text-color);
}
@if not($focus-text-color) and $text-color {
$focus-text-color: dynamic-shade(var(--text-color));
}
@if not($focus-icon-color) and $focus-text-color {
$focus-icon-color: var(--focus-text-color);
}
@if $variant == 'material' {
@if not($focus-underline-color) and $focus-text-color {
$focus-underline-color: var(--focus-text-color);
}
}
@if not($focus-hover-text-color) and $hover-text-color {
$focus-hover-text-color: dynamic-shade(var(--hover-text-color));
}
@if not($focus-hover-icon-color) and $focus-hover-text-color {
$focus-hover-icon-color: var(--focus-hover-text-color);
}
@if $variant == 'material' {
@if not($focus-hover-underline-color) and $focus-hover-text-color {
$focus-hover-underline-color: var(--focus-hover-text-color);
}
}
@if not($focus-pressed-text-color) and $pressed-text-color {
$focus-pressed-text-color: dynamic-shade(var(--pressed-text-color));
}
@if not($focus-pressed-icon-color) and $focus-pressed-text-color {
$focus-pressed-icon-color: var(--focus-pressed-text-color);
}
@if $variant == 'material' {
@if not($focus-pressed-underline-color) and $focus-pressed-text-color {
$focus-pressed-underline-color: var(--focus-pressed-text-color);
}
}
@if not($disabled-icon-color) and $disabled-text-color {
$disabled-icon-color: var(--disabled-text-color);
}
@return extend(
$theme,
(
selector: $selector,
text-color: $text-color,
icon-color: $icon-color,
current-text-color: $current-text-color,
current-icon-color: $current-icon-color,
hover-text-color: $hover-text-color,
hover-icon-color: $hover-icon-color,
pressed-text-color: $pressed-text-color,
pressed-icon-color: $pressed-icon-color,
focus-text-color: $focus-text-color,
focus-icon-color: $focus-icon-color,
focus-underline-color: $focus-underline-color,
focus-border-color: $focus-border-color,
focus-hover-text-color: $focus-hover-text-color,
focus-hover-icon-color: $focus-hover-icon-color,
focus-hover-underline-color: $focus-hover-underline-color,
focus-pressed-text-color: $focus-pressed-text-color,
focus-pressed-icon-color: $focus-pressed-icon-color,
focus-pressed-underline-color: $focus-pressed-underline-color,
disabled-text-color: $disabled-text-color,
disabled-icon-color: $disabled-icon-color,
separator-color: $separator-color,
)
);
}