@progress/kendo-theme-core 9.1.1-dev.2 → 10.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.css +715 -712
- package/dist/all.scss +1 -6420
- package/dist/meta/sassdoc-data.json +3879 -3710
- package/dist/meta/sassdoc-raw-data.json +1844 -2568
- package/dist/meta/variables.json +430 -1219
- package/package.json +2 -3
- package/scss/_variables.scss +5 -3
- package/scss/all.scss +3 -2
- package/scss/border-radii/index.import.scss +13 -10
- package/scss/color-system/_functions.import.scss +182 -33
- package/scss/color-system/_mixins.import.scss +8 -2
- package/scss/color-system/_palettes.scss +272 -972
- package/scss/color-system/_swatch.scss +161 -159
- package/scss/color-system/index.import.scss +5 -6
- package/scss/elevation/index.import.scss +3 -3
- package/scss/functions/_color.import.scss +529 -0
- package/scss/functions/_list.import.scss +11 -9
- package/scss/functions/_map.import.scss +14 -11
- package/scss/functions/_math.import.scss +15 -13
- package/scss/functions/_meta.import.scss +9 -7
- package/scss/functions/_string.import.scss +36 -15
- package/scss/functions/index.import.scss +8 -12
- package/scss/index.import.scss +27 -10
- package/scss/mixins/_border-radius.scss +2 -0
- package/scss/mixins/_box-shadow.scss +2 -0
- package/scss/mixins/_decoration.scss +6 -13
- package/scss/mixins/_focus-indicator.scss +3 -0
- package/scss/mixins/_gradient.scss +2 -0
- package/scss/mixins/_import-once.scss +5 -3
- package/scss/mixins/index.import.scss +8 -8
- package/scss/spacing/index.import.scss +5 -4
- package/scss/styles/_base.scss +10 -6
- package/scss/styles/_selection.scss +6 -6
- package/scss/styles/index.import.scss +34 -22
- package/scss/typography/index.import.scss +10 -8
- package/dist/index.css +0 -0
- package/scss/color-system/_swatch-legacy.scss +0 -90
- package/scss/functions/_color-contrast.import.scss +0 -393
- package/scss/functions/_color-manipulation.import.scss +0 -134
- package/scss/functions/_color-system.import.scss +0 -138
- package/scss/functions/_escape-string.import.scss +0 -48
- package/scss/module-system/_components.scss +0 -240
- package/scss/module-system/_dependencies.scss +0 -731
- package/scss/module-system/index.import.scss +0 -55
- package/scss/styles/_colors.scss +0 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-theme-core",
|
|
3
3
|
"description": "A collection of functions and mixins used for building themes for Kendo UI",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "10.0.0-dev.0",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"build": "sass-build",
|
|
33
33
|
"watch": "node ../../scripts/watch-theme",
|
|
34
34
|
"sass": "sass-build",
|
|
35
|
-
"sass:flat": "gulp dist:flat && sass-build -c sass-flat.config.js",
|
|
36
35
|
"docs": "node ../../scripts/sassdoc.js",
|
|
37
36
|
"predocs": "npm run resolve-variables",
|
|
38
37
|
"resolve-variables": "node ../../scripts/resolve-variables.js",
|
|
@@ -44,5 +43,5 @@
|
|
|
44
43
|
"directories": {
|
|
45
44
|
"doc": "docs"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a7d870863610924d89ac6d01cdc1fb97a26da5e9"
|
|
48
47
|
}
|
package/scss/_variables.scss
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
@import "./functions/index.import.scss";
|
|
2
|
-
|
|
3
1
|
// Options
|
|
2
|
+
$kendo-enable-color-system: true !default;
|
|
3
|
+
$kendo-is-dark-theme: false !default;
|
|
4
4
|
$kendo-enable-shadows: true !default;
|
|
5
5
|
$kendo-enable-rounded: true !default;
|
|
6
6
|
$kendo-enable-gradients: true !default;
|
|
7
7
|
$kendo-enable-transitions: true !default;
|
|
8
|
-
$kendo-nested-disabled:
|
|
8
|
+
$kendo-nested-disabled: true !default;
|
|
9
|
+
$kendo-enable-focus-contrast: false !default;
|
|
10
|
+
$wcag-min-contrast-ratio: 4.5 !default;
|
|
9
11
|
|
|
10
12
|
// Equilateral triangle variables
|
|
11
13
|
// stylelint-disable number-max-precision
|
package/scss/all.scss
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "../spacing/index.import.scss" as *;
|
|
3
|
+
|
|
1
4
|
/// The none border radius used across the Components.
|
|
2
5
|
/// @group radii
|
|
3
|
-
$kendo-border-radius-none:
|
|
6
|
+
$kendo-border-radius-none: map.get($kendo-spacing, 0) !default;
|
|
4
7
|
/// The extra small border radius used across the Components.
|
|
5
8
|
/// @group radii
|
|
6
|
-
$kendo-border-radius-xs:
|
|
9
|
+
$kendo-border-radius-xs: map.get($kendo-spacing, 1px) !default;
|
|
7
10
|
/// The small border radius used across the Components.
|
|
8
11
|
/// @group radii
|
|
9
|
-
$kendo-border-radius-sm:
|
|
12
|
+
$kendo-border-radius-sm: map.get($kendo-spacing, 0.5) !default;
|
|
10
13
|
/// The medium border radius used across the Components.
|
|
11
14
|
/// @group radii
|
|
12
|
-
$kendo-border-radius-md:
|
|
15
|
+
$kendo-border-radius-md: map.get($kendo-spacing, 1) !default;
|
|
13
16
|
/// The large border radius used across the Components.
|
|
14
17
|
/// @group radii
|
|
15
|
-
$kendo-border-radius-lg:
|
|
18
|
+
$kendo-border-radius-lg: map.get($kendo-spacing, 1.5) !default;
|
|
16
19
|
/// The extra large border radius used across the Components.
|
|
17
20
|
/// @group radii
|
|
18
|
-
$kendo-border-radius-xl:
|
|
21
|
+
$kendo-border-radius-xl: map.get($kendo-spacing, 2) !default;
|
|
19
22
|
/// The third largest border radius used across the Components.
|
|
20
23
|
/// @group radii
|
|
21
|
-
$kendo-border-radius-xxl:
|
|
24
|
+
$kendo-border-radius-xxl: map.get($kendo-spacing, 3) !default;
|
|
22
25
|
/// The second largest border radius used across the Components.
|
|
23
26
|
/// @group radii
|
|
24
|
-
$kendo-border-radius-xxxl:
|
|
27
|
+
$kendo-border-radius-xxxl: map.get($kendo-spacing, 4) !default;
|
|
25
28
|
/// The largest border radius used across the Components.
|
|
26
29
|
/// @group radii
|
|
27
30
|
$kendo-border-radius-full: 9999px !default;
|
|
@@ -44,11 +47,11 @@ $kendo-border-radii: $_default-border-radii !default;
|
|
|
44
47
|
|
|
45
48
|
/// The global radii Map.
|
|
46
49
|
/// @group radii
|
|
47
|
-
$kendo-border-radii:
|
|
50
|
+
$kendo-border-radii: map.merge($_default-border-radii, $kendo-border-radii);
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
@function k-border-radius($key) {
|
|
51
|
-
$_border-radius:
|
|
54
|
+
$_border-radius: map.get($kendo-border-radii, $key);
|
|
52
55
|
@return var(--kendo-border-radius-#{$key}, $_border-radius);
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:list";
|
|
3
|
+
@use "sass:string";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "../functions/_string.import.scss" as *;
|
|
6
|
+
@use "../functions/_map.import.scss" as *;
|
|
7
|
+
@use "../functions/_color.import.scss" as *;
|
|
8
|
+
@use "./_palettes.scss" as *;
|
|
9
|
+
@use "./_swatch.scss" as *;
|
|
10
|
+
@use "../_variables.scss" as *;
|
|
2
11
|
|
|
3
12
|
@function k-generate-theme-variant( $variant, $matrix, $src-palette-name ) {
|
|
4
13
|
$result: ();
|
|
5
14
|
|
|
6
15
|
@each $ui-state, $indices in $matrix {
|
|
7
16
|
$prefix: if( $ui-state == DEFAULT, "", "#{$ui-state}-" );
|
|
8
|
-
$indices-count:
|
|
17
|
+
$indices-count: list.length( $indices );
|
|
9
18
|
|
|
10
|
-
$bg-prop:
|
|
11
|
-
$text-prop:
|
|
12
|
-
$border-prop:
|
|
13
|
-
$gradient-prop: if( $indices-count > 3,
|
|
14
|
-
$shadow-prop: if( $indices-count > 4,
|
|
15
|
-
$outline-prop: if( $indices-count > 5,
|
|
19
|
+
$bg-prop: list.nth( $indices, 1 );
|
|
20
|
+
$text-prop: list.nth( $indices, 2 );
|
|
21
|
+
$border-prop: list.nth( $indices, 3 );
|
|
22
|
+
$gradient-prop: if( $indices-count > 3, list.nth( $indices, 4 ), null );
|
|
23
|
+
$shadow-prop: if( $indices-count > 4, list.nth( $indices, 5 ), null );
|
|
24
|
+
$outline-prop: if( $indices-count > 5, list.nth( $indices, 6 ), null );
|
|
16
25
|
|
|
17
26
|
// Take value from the palette only if it is a number
|
|
18
|
-
$bg: if(
|
|
19
|
-
$text: if(
|
|
20
|
-
$border: if(
|
|
27
|
+
$bg: if( meta.type-of( $bg-prop ) == number, k-get-theme-color( $src-palette-name, $bg-prop ), $bg-prop );
|
|
28
|
+
$text: if( meta.type-of( $text-prop ) == number, k-get-theme-color( $src-palette-name, $text-prop ), $text-prop );
|
|
29
|
+
$border: if( meta.type-of( $border-prop ) == number, k-get-theme-color( $src-palette-name, $border-prop ), $border-prop );
|
|
21
30
|
$gradient: $gradient-prop;
|
|
22
31
|
$shadow: $shadow-prop;
|
|
23
32
|
$outline: $outline-prop;
|
|
24
33
|
|
|
25
|
-
$result:
|
|
34
|
+
$result: map.merge($result, (
|
|
26
35
|
#{$prefix}bg: $bg,
|
|
27
36
|
#{$prefix}text: $text,
|
|
28
37
|
#{$prefix}border: $border,
|
|
@@ -48,25 +57,25 @@
|
|
|
48
57
|
// @debug $palette-matrix;
|
|
49
58
|
|
|
50
59
|
@each $variant, $definition in $theme-matrix {
|
|
51
|
-
$tc-index:
|
|
52
|
-
$src-palette-name:
|
|
53
|
-
$matrix:
|
|
60
|
+
$tc-index: string.index( $variant, "THEME_COLOR" );
|
|
61
|
+
$src-palette-name: map.get( $definition, PALETTE );
|
|
62
|
+
$matrix: map.remove( $definition, PALETTE );
|
|
54
63
|
|
|
55
64
|
@if ($tc-index == null ) { // stylelint-disable-line
|
|
56
65
|
$tmp-result: k-generate-theme-variant( $variant, $matrix, $src-palette-name );
|
|
57
|
-
$result:
|
|
66
|
+
$result: map.merge( $result, $tmp-result);
|
|
58
67
|
} @else {
|
|
59
68
|
@each $color, $palette in $palette-matrix {
|
|
60
69
|
$variant-name: k-string-replace( $variant, THEME_COLOR, $color);
|
|
61
|
-
$palette-name:
|
|
70
|
+
$palette-name: string.unquote($src-palette-name + "");
|
|
62
71
|
|
|
63
72
|
@if ($palette-name == THEME_COLOR) {
|
|
64
73
|
$palette-name: k-string-replace( $palette-name, THEME_COLOR, $color );
|
|
65
|
-
$palette-name:
|
|
74
|
+
$palette-name: map.get( $palette-matrix, $palette-name );
|
|
66
75
|
}
|
|
67
76
|
|
|
68
77
|
$tmp-result: k-generate-theme-variant( $variant-name, $matrix, $palette-name );
|
|
69
|
-
$result:
|
|
78
|
+
$result: map.merge( $result, $tmp-result );
|
|
70
79
|
}
|
|
71
80
|
}
|
|
72
81
|
}
|
|
@@ -76,15 +85,15 @@
|
|
|
76
85
|
|
|
77
86
|
|
|
78
87
|
@function k-get-theme-palette( $name ) {
|
|
79
|
-
@return
|
|
88
|
+
@return map.get( $kendo-palettes, $name );
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
@function k-get-theme-color( $palette, $hue ) {
|
|
83
|
-
@if (
|
|
84
|
-
@return
|
|
92
|
+
@if ( meta.type-of( $palette ) == "map" ) {
|
|
93
|
+
@return map.get( $palette, $hue );
|
|
85
94
|
}
|
|
86
95
|
|
|
87
|
-
@return
|
|
96
|
+
@return map.get( k-get-theme-palette( $palette ), $hue );
|
|
88
97
|
}
|
|
89
98
|
|
|
90
99
|
@function k-get-theme-color-var( $name, $fallback: "inherit", $prefix: "kendo-" ) {
|
|
@@ -113,7 +122,7 @@
|
|
|
113
122
|
on-color-disabled: color-mix(in srgb, k-color( on-#{$color} ) 46%, transparent)
|
|
114
123
|
);
|
|
115
124
|
|
|
116
|
-
@return if(
|
|
125
|
+
@return if( map.has-key( $map, $name ), map.get( $map, $name ), $name );
|
|
117
126
|
};
|
|
118
127
|
|
|
119
128
|
@function k-generate-theme-variation( $theme-color, $source-palette-name, $mapping ) {
|
|
@@ -122,14 +131,14 @@
|
|
|
122
131
|
@each $ui-state, $indices in $mapping {
|
|
123
132
|
$prefix: if( $ui-state == normal, '', '#{$ui-state}-' );
|
|
124
133
|
|
|
125
|
-
$bg-prop:
|
|
126
|
-
$text-prop:
|
|
127
|
-
$border-prop:
|
|
134
|
+
$bg-prop: list.nth($indices, 1);
|
|
135
|
+
$text-prop: list.nth($indices, 2);
|
|
136
|
+
$border-prop: list.nth($indices, 3);
|
|
128
137
|
|
|
129
138
|
// Take value from the palette only if it is a number
|
|
130
|
-
$bg: if($kendo-enable-color-system, k-get-swatch-color( $bg-prop, $source-palette-name ), if(
|
|
131
|
-
$text: if($kendo-enable-color-system, k-get-swatch-color( $text-prop, $source-palette-name ), if(
|
|
132
|
-
$border: if($kendo-enable-color-system, k-get-swatch-color( $border-prop, $source-palette-name ), if(
|
|
139
|
+
$bg: if($kendo-enable-color-system, k-get-swatch-color( $bg-prop, $source-palette-name ), if( meta.type-of($bg-prop) == number, k-get-theme-color-var( #{$source-palette-name}-#{$bg-prop} ), $bg-prop ));
|
|
140
|
+
$text: if($kendo-enable-color-system, k-get-swatch-color( $text-prop, $source-palette-name ), if( meta.type-of($text-prop) == number, k-get-theme-color-var( #{$source-palette-name}-#{$text-prop} ), $text-prop ));
|
|
141
|
+
$border: if($kendo-enable-color-system, k-get-swatch-color( $border-prop, $source-palette-name ), if( meta.type-of($border-prop) == number, k-get-theme-color-var( #{$source-palette-name}-#{$border-prop} ), $border-prop ));
|
|
133
142
|
|
|
134
143
|
|
|
135
144
|
$temp: k-map-deep-merge( $temp, (
|
|
@@ -139,9 +148,9 @@
|
|
|
139
148
|
));
|
|
140
149
|
|
|
141
150
|
// Add outline if provided in the map
|
|
142
|
-
@if (
|
|
143
|
-
$outline-prop:
|
|
144
|
-
$outline: if($kendo-enable-color-system, k-get-swatch-color( $outline-prop, $source-palette-name ), if(
|
|
151
|
+
@if ( list.length($indices) > 3 ) {
|
|
152
|
+
$outline-prop: list.nth($indices, 4);
|
|
153
|
+
$outline: if($kendo-enable-color-system, k-get-swatch-color( $outline-prop, $source-palette-name ), if( meta.type-of($outline-prop) == number, k-get-theme-color-var( #{$source-palette-name}-#{$outline-prop} ), $outline-prop ));
|
|
145
154
|
|
|
146
155
|
$temp: k-map-deep-merge( $temp, (
|
|
147
156
|
#{$prefix}outline: $outline
|
|
@@ -179,3 +188,143 @@
|
|
|
179
188
|
@return null;
|
|
180
189
|
}
|
|
181
190
|
}
|
|
191
|
+
|
|
192
|
+
/// Generates all color variations of a given main color
|
|
193
|
+
/// @param {String} $name - The name of the main color
|
|
194
|
+
/// @param {Color} $color - The color value to be assigned to the main color
|
|
195
|
+
/// @param {String} $theme - The theme the colors will be generated for
|
|
196
|
+
/// @return {Map} - A map with the generated keys and values
|
|
197
|
+
///
|
|
198
|
+
/// @group color-system
|
|
199
|
+
@function k-generate-color-variations( $name, $color, $theme: null ) {
|
|
200
|
+
$result: ();
|
|
201
|
+
|
|
202
|
+
// DataViz
|
|
203
|
+
@if (
|
|
204
|
+
$name == 'series-a' or
|
|
205
|
+
$name == 'series-b' or
|
|
206
|
+
$name == 'series-c' or
|
|
207
|
+
$name == 'series-d' or
|
|
208
|
+
$name == 'series-e' or
|
|
209
|
+
$name == 'series-f'
|
|
210
|
+
) {
|
|
211
|
+
$_variations: (
|
|
212
|
+
#{$name}: $color,
|
|
213
|
+
#{$name}-bold: k-color-mix(black, $color, 25%),
|
|
214
|
+
#{$name}-bolder: k-color-mix(black, $color, 50%),
|
|
215
|
+
#{$name}-subtle: k-color-mix(white, $color, 25%),
|
|
216
|
+
#{$name}-subtler: k-color-mix(white, $color, 50%),
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
$result: map.merge($result, $_variations);
|
|
220
|
+
} @else {
|
|
221
|
+
// Default
|
|
222
|
+
@if ( $theme == 'default' or $theme == null ) { // stylelint-disable-line
|
|
223
|
+
$_variations: (
|
|
224
|
+
#{$name}-subtle: if( $name == 'base', k-try-shade( $color, 4% ), k-try-tint( $color, 80% )),
|
|
225
|
+
#{$name}-subtle-hover: if( $name == 'base', k-try-shade( $color, 8% ), k-try-tint($color, 65% )),
|
|
226
|
+
#{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 13% ), k-try-tint( $color, 50% )),
|
|
227
|
+
#{$name}: $color,
|
|
228
|
+
#{$name}-hover: k-try-shade( $color, 0.5 ),
|
|
229
|
+
#{$name}-active: k-try-shade( $color, 1.5 ),
|
|
230
|
+
#{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 21% ), k-try-tint( $color, 25% )),
|
|
231
|
+
#{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 75% ), k-try-shade( $color, 65% )),
|
|
232
|
+
on-#{$name}: if( $name == 'base', k-try-shade( $color, 75% ), k-contrast-legacy( $color )),
|
|
233
|
+
#{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 75% ), k-try-shade( $color, 25% )),
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
$result: map.merge($result, $_variations);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Bootstrap
|
|
240
|
+
@if ( $theme == 'bootstrap' ) {
|
|
241
|
+
$_variations: (
|
|
242
|
+
#{$name}-subtle: if( $name == 'base', k-try-tint( $color, 30% ), k-try-tint( $color, 80% )),
|
|
243
|
+
#{$name}-subtle-hover: if( $name == 'base', $color, k-try-tint($color, 65% )),
|
|
244
|
+
#{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 8% ), k-try-tint( $color, 50% )),
|
|
245
|
+
#{$name}: $color,
|
|
246
|
+
#{$name}-hover: k-color-darken( $color, 7.5% ),
|
|
247
|
+
#{$name}-active: k-color-darken( $color, 10% ),
|
|
248
|
+
#{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 21% ), k-try-tint( $color, 25% )),
|
|
249
|
+
#{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 65% )),
|
|
250
|
+
on-#{$name}: if( $name == 'base', k-try-shade( $color, 84% ), k-contrast-legacy( $color )),
|
|
251
|
+
#{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 25% )),
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
$result: map.merge($result, $_variations);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Material
|
|
258
|
+
@if ( $theme == 'material' ) {
|
|
259
|
+
$_variations: (
|
|
260
|
+
#{$name}-subtle: if( $name == 'base', k-try-shade( $color, 12% ), k-try-tint( $color, 80% )),
|
|
261
|
+
#{$name}-subtle-hover: if( $name == 'base', k-try-shade( $color, 16% ), k-try-tint($color, 65% )),
|
|
262
|
+
#{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 24% ), k-try-tint( $color, 50% )),
|
|
263
|
+
#{$name}: $color,
|
|
264
|
+
#{$name}-hover: k-try-shade( $color, 0.5 ),
|
|
265
|
+
#{$name}-active: k-try-shade( $color, 1.5 ),
|
|
266
|
+
#{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 32% ), k-try-tint( $color, 25% )),
|
|
267
|
+
#{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 87% ), k-try-shade( $color, 65% )),
|
|
268
|
+
on-#{$name}: if( $name == 'base', k-try-shade( $color, 87% ), k-contrast-color( $color )),
|
|
269
|
+
#{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 87% ), k-try-shade( $color, 50% )),
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
$result: map.merge($result, $_variations);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Fluent
|
|
276
|
+
@if ( $theme == 'fluent' ) {
|
|
277
|
+
$_variations: (
|
|
278
|
+
#{$name}-subtle: if( $name == 'base', k-try-shade( $color, 2% ), k-try-tint( $color, 80% )),
|
|
279
|
+
#{$name}-subtle-hover: if( $name == 'base', k-try-shade( $color, 8% ), k-try-tint($color, 65% )),
|
|
280
|
+
#{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 12% ), k-try-tint( $color, 50% )),
|
|
281
|
+
#{$name}: $color,
|
|
282
|
+
#{$name}-hover: k-try-shade( $color, 0.5 ),
|
|
283
|
+
#{$name}-active: k-try-shade( $color, 1.5 ),
|
|
284
|
+
#{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 18% ), k-try-tint( $color, 25% )),
|
|
285
|
+
#{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 74% ), k-try-shade( $color, 65% )),
|
|
286
|
+
on-#{$name}: if( $name == 'base', k-try-shade( $color, 86% ), k-contrast-legacy( $color )),
|
|
287
|
+
#{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 86% ), k-try-shade( $color, 25% )),
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
$result: map.merge($result, $_variations);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Classic
|
|
294
|
+
@if ( $theme == 'classic' ) {
|
|
295
|
+
$_variations: (
|
|
296
|
+
#{$name}-subtle: if( $name == 'base', k-try-tint( $color, 20% ), k-try-tint( $color, 80% )),
|
|
297
|
+
#{$name}-subtle-hover: if( $name == 'base', k-try-tint( $color, 8% ), k-try-tint($color, 65% )),
|
|
298
|
+
#{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 6% ), k-try-tint( $color, 50% )),
|
|
299
|
+
#{$name}: $color,
|
|
300
|
+
#{$name}-hover: k-try-shade( $color, 1 ),
|
|
301
|
+
#{$name}-active: k-try-shade( $color, 2 ),
|
|
302
|
+
#{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 14% ), k-try-tint( $color, 25% )),
|
|
303
|
+
#{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 65% )),
|
|
304
|
+
on-#{$name}: if( $name == 'base', k-try-shade( $color, 84% ), k-contrast-legacy( $color )),
|
|
305
|
+
#{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 25% )),
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
$result: map.merge($result, $_variations);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@return $result;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/// Takes a color name from the $kendo-colors map as a parameter
|
|
316
|
+
/// and returns a CSS variable with the actual color as a fallback
|
|
317
|
+
/// @param {String} $key - The name of a color/key in the $kendo-colors map
|
|
318
|
+
/// @return {String} - CSS variable with the actual color as a fallback
|
|
319
|
+
///
|
|
320
|
+
/// @group color-system
|
|
321
|
+
@function k-color($key) {
|
|
322
|
+
$_color: map.get($kendo-colors, $key);
|
|
323
|
+
|
|
324
|
+
@if ($_color) {
|
|
325
|
+
@return var(--kendo-color-#{$key}, $_color);
|
|
326
|
+
} @else {
|
|
327
|
+
@error "Color Variable \`#{$key}\` does not exists in the color collection.";
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
@use "sass:meta";
|
|
2
|
+
|
|
1
3
|
@mixin k-css-vars($map) {
|
|
2
4
|
@each $group, $values in $map {
|
|
3
|
-
@
|
|
4
|
-
--kendo-#{
|
|
5
|
+
@if meta.type-of($values) != 'map' {
|
|
6
|
+
--kendo-text-#{$group}: #{$values};
|
|
7
|
+
} @else {
|
|
8
|
+
@each $key, $value in $values {
|
|
9
|
+
--kendo-#{meta.inspect($group)}-#{$key}: #{$value};
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
}
|
|
7
13
|
}
|