@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.
Files changed (45) hide show
  1. package/dist/all.css +715 -712
  2. package/dist/all.scss +1 -6420
  3. package/dist/meta/sassdoc-data.json +3879 -3710
  4. package/dist/meta/sassdoc-raw-data.json +1844 -2568
  5. package/dist/meta/variables.json +430 -1219
  6. package/package.json +2 -3
  7. package/scss/_variables.scss +5 -3
  8. package/scss/all.scss +3 -2
  9. package/scss/border-radii/index.import.scss +13 -10
  10. package/scss/color-system/_functions.import.scss +182 -33
  11. package/scss/color-system/_mixins.import.scss +8 -2
  12. package/scss/color-system/_palettes.scss +272 -972
  13. package/scss/color-system/_swatch.scss +161 -159
  14. package/scss/color-system/index.import.scss +5 -6
  15. package/scss/elevation/index.import.scss +3 -3
  16. package/scss/functions/_color.import.scss +529 -0
  17. package/scss/functions/_list.import.scss +11 -9
  18. package/scss/functions/_map.import.scss +14 -11
  19. package/scss/functions/_math.import.scss +15 -13
  20. package/scss/functions/_meta.import.scss +9 -7
  21. package/scss/functions/_string.import.scss +36 -15
  22. package/scss/functions/index.import.scss +8 -12
  23. package/scss/index.import.scss +27 -10
  24. package/scss/mixins/_border-radius.scss +2 -0
  25. package/scss/mixins/_box-shadow.scss +2 -0
  26. package/scss/mixins/_decoration.scss +6 -13
  27. package/scss/mixins/_focus-indicator.scss +3 -0
  28. package/scss/mixins/_gradient.scss +2 -0
  29. package/scss/mixins/_import-once.scss +5 -3
  30. package/scss/mixins/index.import.scss +8 -8
  31. package/scss/spacing/index.import.scss +5 -4
  32. package/scss/styles/_base.scss +10 -6
  33. package/scss/styles/_selection.scss +6 -6
  34. package/scss/styles/index.import.scss +34 -22
  35. package/scss/typography/index.import.scss +10 -8
  36. package/dist/index.css +0 -0
  37. package/scss/color-system/_swatch-legacy.scss +0 -90
  38. package/scss/functions/_color-contrast.import.scss +0 -393
  39. package/scss/functions/_color-manipulation.import.scss +0 -134
  40. package/scss/functions/_color-system.import.scss +0 -138
  41. package/scss/functions/_escape-string.import.scss +0 -48
  42. package/scss/module-system/_components.scss +0 -240
  43. package/scss/module-system/_dependencies.scss +0 -731
  44. package/scss/module-system/index.import.scss +0 -55
  45. package/scss/styles/_colors.scss +0 -5
@@ -1,4 +1,6 @@
1
- @import "../functions/index.import.scss";
1
+ @use "sass:map";
2
+ @use "sass:meta";
3
+ @use "sass:math";
2
4
 
3
5
  /// The base font size across all components.
4
6
  /// @group typography
@@ -24,7 +26,7 @@ $kendo-font-size-xl: 1.25rem !default;
24
26
 
25
27
  /// The base line height across all components.
26
28
  /// @group typography
27
- $kendo-line-height: k-math-div( 20, 14 ) !default;
29
+ $kendo-line-height: math.div( 20, 14 ) !default;
28
30
  /// The extra small line height across all components.
29
31
  /// @group typography
30
32
  $kendo-line-height-xs: 1 !default;
@@ -161,31 +163,31 @@ $kendo-font-sizes: $_default-font-sizes !default;
161
163
 
162
164
  /// The font sizes map
163
165
  /// @group typography
164
- $kendo-font-sizes: k-map-merge( $_default-font-sizes, $kendo-font-sizes );
166
+ $kendo-font-sizes: map.merge( $_default-font-sizes, $kendo-font-sizes );
165
167
 
166
168
  $kendo-line-heights: $_default-line-heights !default;
167
169
 
168
170
  /// The line heights map
169
171
  /// @group typography
170
- $kendo-line-heights: k-map-merge( $_default-line-heights, $kendo-line-heights );
172
+ $kendo-line-heights: map.merge( $_default-line-heights, $kendo-line-heights );
171
173
 
172
174
  $kendo-font-weights: $_default-font-weights !default;
173
175
 
174
176
  /// The font weights map
175
177
  /// @group typography
176
- $kendo-font-weights: k-map-merge( $_default-font-weights, $kendo-font-weights );
178
+ $kendo-font-weights: map.merge( $_default-font-weights, $kendo-font-weights );
177
179
 
178
180
  $kendo-letter-spacings: $_default-letter-spacings !default;
179
181
 
180
182
  /// The letter spacings map
181
183
  /// @group typography
182
- $kendo-letter-spacings: k-map-merge( $_default-letter-spacings, $kendo-letter-spacings );
184
+ $kendo-letter-spacings: map.merge( $_default-letter-spacings, $kendo-letter-spacings );
183
185
 
184
186
  $kendo-font-families: $_default-font-families !default;
185
187
 
186
188
  /// The font families map
187
189
  /// @group typography
188
- $kendo-font-families: k-map-merge( $_default-font-families, $kendo-font-families );
190
+ $kendo-font-families: map.merge( $_default-font-families, $kendo-font-families );
189
191
 
190
192
  @mixin typography( $font-size: null, $font-family: null, $line-height: null, $font-weight: null, $letter-spacing: null ) {
191
193
  font-size: $font-size;
@@ -199,7 +201,7 @@ $kendo-font-families: k-map-merge( $_default-font-families, $kendo-font-families
199
201
  @mixin kendo-core--typography--styles() {
200
202
  :root {
201
203
 
202
- --kendo-font-family: #{k-meta-inspect($kendo-font-family)};
204
+ --kendo-font-family: #{meta.inspect($kendo-font-family)};
203
205
  --kendo-font-size: #{$kendo-font-size};
204
206
  --kendo-line-height: #{$kendo-line-height};
205
207
  --kendo-font-weight: #{$kendo-font-weight};
package/dist/index.css DELETED
File without changes
@@ -1,90 +0,0 @@
1
- $kendo-is-dark-theme: false !default;
2
-
3
- // Root styles
4
- $kendo-body-bg: null !default;
5
- $kendo-body-text: null !default;
6
-
7
- // Component styles
8
- $kendo-component-bg: null !default;
9
- $kendo-component-text: null !default;
10
- $kendo-component-border: null !default;
11
-
12
- // States styles
13
- $kendo-hover-bg: null !default;
14
- $kendo-hover-text: null !default;
15
- $kendo-hover-border: null !default;
16
-
17
- $kendo-selected-bg: null !default;
18
- $kendo-selected-text: null !default;
19
- $kendo-selected-border: null !default;
20
-
21
- $kendo-selected-hover-bg: null !default;
22
- $kendo-selected-hover-text: null !default;
23
- $kendo-selected-hover-border: null !default;
24
-
25
- $kendo-focus-outline: null !default;
26
-
27
- $kendo-subtle-text: null !default;
28
-
29
- // Link
30
- $kendo-link-text: null !default;
31
- $kendo-link-hover-text: null !default;
32
-
33
- // Validator
34
- $kendo-invalid-bg: null !default;
35
- $kendo-invalid-text: null !default;
36
- $kendo-invalid-border: null !default;
37
- $kendo-invalid-shadow: null !default;
38
-
39
- // Disabled Styling
40
-
41
- /// The background color of disabled items.
42
- $kendo-disabled-bg: null !default;
43
- /// The text color of disabled items.
44
- $kendo-disabled-text: null !default;
45
- /// The border color of disabled items.
46
- $kendo-disabled-border: null !default;
47
- /// The opacity of disabled items.
48
- $kendo-disabled-opacity: null !default;
49
- /// The filter of disabled items.
50
- $kendo-disabled-filter: null !default;
51
-
52
- $kendo-disabled-styling: (
53
- bg: $kendo-disabled-bg,
54
- color: $kendo-disabled-text,
55
- border: $kendo-disabled-border,
56
- opacity: $kendo-disabled-opacity,
57
- filter: $kendo-disabled-filter
58
- ) !default;
59
-
60
-
61
- $kendo-palettes: () !default;
62
- $kendo-theme-colors: () !default;
63
-
64
- @mixin color-system-styles() {
65
- :root {
66
- @include k-css-vars($kendo-palettes);
67
- @include k-css-vars($kendo-theme-colors);
68
-
69
- // Text colors
70
- @each $theme-color, $color-props in $kendo-theme-colors {
71
- $_color: k-map-get($color-props, text);
72
-
73
- .k-text-#{$theme-color},
74
- .k-color-#{$theme-color} {
75
- color: var(--kendo-text-#{$theme-color}, #{$_color});
76
- }
77
- .\!k-text-#{$theme-color},
78
- .\!k-color-#{$theme-color} {
79
- color: var(--kendo-text-#{$theme-color}, #{$_color}) !important; // stylelint-disable-line declaration-no-important
80
- }
81
-
82
- .k-bg-#{$theme-color} {
83
- background-color: var(--kendo-bg-#{$theme-color}, #{$_color});
84
- }
85
- .\!k-bg-#{$theme-color} {
86
- background-color: var(--kendo-bg-#{$theme-color}, #{$_color}) !important; // stylelint-disable-line declaration-no-important
87
- }
88
- }
89
- }
90
- }
@@ -1,393 +0,0 @@
1
- // Adapted from https://gist.github.com/sgomes/ccc72f71137fe29039c92c0a9fe9b657
2
- // Adapted from https://github.com/twbs/bootstrap/commit/03908ea37a55eaa44c12ce5694dddc1630c980b3
3
-
4
- // Precomputed linear color channel values, for use in contrast calculations.
5
- // See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
6
- // Algorithm, for c in 0 to 255:
7
- // f(c) {
8
- // c = c / 255;
9
- // return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
10
- // }
11
- // This lookup table is needed since there is no `pow` in SASS.
12
- // stylelint-disable number-max-precision
13
- $_linear-channel-values: (
14
- 0
15
- .0003035269835488375
16
- .000607053967097675
17
- .0009105809506465125
18
- .00121410793419535
19
- .0015176349177441874
20
- .001821161901293025
21
- .0021246888848418626
22
- .0024282158683907
23
- .0027317428519395373
24
- .003035269835488375
25
- .003346535763899161
26
- .003676507324047436
27
- .004024717018496307
28
- .004391442037410293
29
- .004776953480693729
30
- .005181516702338386
31
- .005605391624202723
32
- .006048833022857054
33
- .006512090792594475
34
- .006995410187265387
35
- .007499032043226175
36
- .008023192985384994
37
- .008568125618069307
38
- .009134058702220787
39
- .00972121732023785
40
- .010329823029626936
41
- .010960094006488246
42
- .011612245179743885
43
- .012286488356915872
44
- .012983032342173012
45
- .013702083047289686
46
- .014443843596092545
47
- .01520851442291271
48
- .01599629336550963
49
- .016807375752887384
50
- .017641954488384078
51
- .018500220128379697
52
- .019382360956935723
53
- .0202885630566524
54
- .021219010376003555
55
- .022173884793387385
56
- .02315336617811041
57
- .024157632448504756
58
- .02518685962736163
59
- .026241221894849898
60
- .027320891639074894
61
- .028426039504420793
62
- .0295568344378088
63
- .030713443732993635
64
- .03189603307301153
65
- .033104766570885055
66
- .03433980680868217
67
- .03560131487502034
68
- .03688945040110004
69
- .0382043715953465
70
- .03954623527673284
71
- .04091519690685319
72
- .042311410620809675
73
- .043735029256973465
74
- .04518620438567554
75
- .046665086336880095
76
- .04817182422688942
77
- .04970656598412723
78
- .05126945837404324
79
- .052860647023180246
80
- .05448027644244237
81
- .05612849004960009
82
- .05780543019106723
83
- .0595112381629812
84
- .06124605423161761
85
- .06301001765316767
86
- .06480326669290577
87
- .06662593864377289
88
- .06847816984440017
89
- .07036009569659588
90
- .07227185068231748
91
- .07421356838014963
92
- .07618538148130785
93
- .07818742180518633
94
- .08021982031446832
95
- .0822827071298148
96
- .08437621154414882
97
- .08650046203654976
98
- .08865558628577294
99
- .09084171118340768
100
- .09305896284668745
101
- .0953074666309647
102
- .09758734714186246
103
- .09989872824711389
104
- .10224173308810132
105
- .10461648409110419
106
- .10702310297826761
107
- .10946171077829933
108
- .1119324278369056
109
- .11443537382697373
110
- .11697066775851084
111
- .11953842798834562
112
- .12213877222960187
113
- .12477181756095049
114
- .12743768043564743
115
- .1301364766903643
116
- .13286832155381798
117
- .13563332965520566
118
- .13843161503245183
119
- .14126329114027164
120
- .14412847085805777
121
- .14702726649759498
122
- .14995978981060856
123
- .15292615199615017
124
- .1559264637078274
125
- .1589608350608804
126
- .162029375639111
127
- .1651321945016676
128
- .16826940018969075
129
- .1714411007328226
130
- .17464740365558504
131
- .17788841598362912
132
- .18116424424986022
133
- .184474994500441
134
- .18782077230067787
135
- .19120168274079138
136
- .1946178304415758
137
- .19806931955994886
138
- .20155625379439707
139
- .20507873639031693
140
- .20863687014525575
141
- .21223075741405523
142
- .21586050011389926
143
- .2195261997292692
144
- .2232279573168085
145
- .22696587351009836
146
- .23074004852434915
147
- .23455058216100522
148
- .238397573812271
149
- .24228112246555486
150
- .24620132670783548
151
- .25015828472995344
152
- .25415209433082675
153
- .2581828529215958
154
- .26225065752969623
155
- .26635560480286247
156
- .2704977910130658
157
- .27467731206038465
158
- .2788942634768104
159
- .2831487404299921
160
- .2874408377269175
161
- .29177064981753587
162
- .2961382707983211
163
- .3005437944157765
164
- .3049873140698863
165
- .30946892281750854
166
- .31398871337571754
167
- .31854677812509186
168
- .32314320911295075
169
- .3277780980565422
170
- .33245153634617935
171
- .33716361504833037
172
- .3419144249086609
173
- .3467040563550296
174
- .35153259950043936
175
- .3564001441459435
176
- .3613067797835095
177
- .3662525955988395
178
- .3712376804741491
179
- .3762621229909065
180
- .38132601143253014
181
- .386429433787049
182
- .39157247774972326
183
- .39675523072562685
184
- .4019777798321958
185
- .4072402119017367
186
- .41254261348390375
187
- .4178850708481375
188
- .4232676699860717
189
- .4286904966139066
190
- .43415363617474895
191
- .4396571738409188
192
- .44520119451622786
193
- .45078578283822346
194
- .45641102318040466
195
- .4620769996544071
196
- .467783796112159
197
- .47353149614800955
198
- .4793201831008268
199
- .4851499400560704
200
- .4910208498478356
201
- .4969329950608704
202
- .5028864580325687
203
- .5088813208549338
204
- .5149176653765214
205
- .5209955732043543
206
- .5271151257058131
207
- .5332764040105052
208
- .5394794890121072
209
- .5457244613701866
210
- .5520114015120001
211
- .5583403896342679
212
- .5647115057049292
213
- .5711248294648731
214
- .5775804404296506
215
- .5840784178911641
216
- .5906188409193369
217
- .5972017883637634
218
- .6038273388553378
219
- .6104955708078648
220
- .6172065624196511
221
- .6239603916750761
222
- .6307571363461468
223
- .6375968739940326
224
- .6444796819705821
225
- .6514056374198242
226
- .6583748172794485
227
- .665387298282272
228
- .6724431569576875
229
- .6795424696330938
230
- .6866853124353135
231
- .6938717612919899
232
- .7011018919329731
233
- .7083757798916868
234
- .7156935005064807
235
- .7230551289219693
236
- .7304607400903537
237
- .7379104087727308
238
- .7454042095403874
239
- .7529422167760779
240
- .7605245046752924
241
- .768151147247507
242
- .7758222183174236
243
- .7835377915261935
244
- .7912979403326302
245
- .799102738014409
246
- .8069522576692516
247
- .8148465722161012
248
- .8227857543962835
249
- .8307698767746546
250
- .83879901174074
251
- .846873231509858
252
- .8549926081242338
253
- .8631572134541023
254
- .8713671191987972
255
- .8796223968878317
256
- .8879231178819663
257
- .8962693533742664
258
- .9046611743911496
259
- .9130986517934192
260
- .9215818562772946
261
- .9301108583754237
262
- .938685728457888
263
- .9473065367331999
264
- .9559733532492861
265
- .9646862478944651
266
- .9734452903984125
267
- .9822505503331171
268
- .9911020971138298
269
- 1
270
- );
271
- // stylelint-enable number-max-precision
272
-
273
- /// The contrast ratio to reach against white, to determine if color changes from "light" to "dark".
274
- /// Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
275
- /// @type Number
276
- /// @group accessibility
277
- ///
278
- /// @link https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
279
- /// @link https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
280
- $wcag-min-contrast-ratio: 7 !default;
281
- /// Default dark color for WCAG 2.0.
282
- /// @type Color
283
- /// @group accessibility
284
- $wcag-dark: black !default;
285
- /// Default light color for WCAG 2.0.
286
- /// @type Color
287
- /// @group accessibility
288
- $wcag-light: white !default;
289
-
290
- /// Calculate the relative luminance for a color.
291
- /// @param {Color} $color - The color to calculate the relative luminance for.
292
- /// @return {Number} - The relative luminance for the color.
293
- ///
294
- /// @group accessibility
295
- ///
296
- /// @link https://www.w3.org/TR/WCAG/#dfn-relative-luminance
297
- /// @link https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
298
- @function k-color-luminance( $color ) {
299
- $red: k-list-nth( $_linear-channel-values, k-color-red( $color ) + 1 );
300
- $green: k-list-nth( $_linear-channel-values, k-color-green( $color ) + 1 );
301
- $blue: k-list-nth( $_linear-channel-values, k-color-blue( $color ) + 1 );
302
-
303
- @return .2126 * $red + .7152 * $green + .0722 * $blue;
304
- }
305
-
306
- /// Calculates contrast ratio between two colors
307
- /// @param {Color} $background - The background color
308
- /// @param {Color} $foreground - The foreground color
309
- /// @return {Number} - The contrast ratio between the two colors
310
- ///
311
- /// @group accessibility
312
- ///
313
- /// @link https://www.w3.org/TR/WCAG/#dfn-contrast-ratio
314
- /// @link https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
315
- @function k-color-contrast-ratio( $background, $foreground ) {
316
- $backLum: k-color-luminance( $background ) + .05;
317
- $foreLum: k-color-luminance( $foreground ) + .05;
318
-
319
- @return k-math-div( k-math-max( $backLum, $foreLum ), k-math-min( $backLum, $foreLum ) );
320
- }
321
-
322
- /// Checks if a color is dark
323
- /// @param {Color} $color - The color to check
324
- /// @return {Boolean} - True if the color is dark, false otherwise
325
- ///
326
- /// @group accessibility
327
- @function k-is-dark( $color ) {
328
- @return if( k-color-luminance( $color ) < .5, true, false );
329
- }
330
-
331
- /// Checks if a color is light
332
- /// @param {Color} $color - The color to check
333
- /// @return {Boolean} - True if the color is light, false otherwise
334
- ///
335
- /// @group accessibility
336
- @function k-is-light( $color ) {
337
- @return if( k-color-luminance( $color ) < .5, false, true );
338
- }
339
-
340
-
341
- /// Calculates the contrast ratio between a background color and a foreground color.
342
- /// If the contrast ratio is not high enough, it will return the color with the highest contrast ratio.
343
- /// @param {Color} $background - The background color
344
- /// @param {Color} $dark - The dark color to use as a fallback
345
- /// @param {Color} $light - The light color to use as a fallback
346
- /// @param {Number} $min-ratio - The minimum contrast ratio to reach
347
- /// @return {Color} - The color with the highest contrast ratio
348
- ///
349
- /// @group accessibility
350
- @function k-contrast-color( $background, $dark: $wcag-dark, $light: $wcag-light, $min-ratio: $wcag-min-contrast-ratio ) {
351
- $foregrounds: $light, $dark, #ffffff, #000000;
352
- $max-ratio: 0;
353
- $max-ratio-color: null;
354
-
355
- @each $color in $foregrounds {
356
- $contrast-ratio: k-color-contrast-ratio( $background, $color );
357
-
358
- @if ( $contrast-ratio > $min-ratio ) {
359
- @return $color;
360
- } @else if ( $contrast-ratio > $max-ratio ) {
361
- $max-ratio: $contrast-ratio;
362
- $max-ratio-color: $color;
363
- }
364
- }
365
-
366
- @warn "Found no color leading to #{$min-ratio}:1 contrast ratio against #{$background}...";
367
-
368
- @return $max-ratio-color;
369
- }
370
-
371
-
372
- // Legacy functions
373
- @function k-yiq-luma-information($color) {
374
- $r: k-color-red($color);
375
- $g: k-color-green($color);
376
- $b: k-color-blue($color);
377
-
378
- $yiq: k-math-div( (($r * 299) + ($g * 587) + ($b * 114)), 1000 );
379
-
380
- @return $yiq;
381
- }
382
- @function k-contrast-yiq($color, $dark: $yiq-dark, $light: $yiq-light) {
383
- $yiq: k-yiq-luma-information($color);
384
- $out: if($yiq >= $yiq-threshold, $dark, $light);
385
- // @debug yiq;
386
- @return $out;
387
- }
388
- @function k-contrast-legacy($color, $dark: $wcag-dark, $light: $wcag-light) {
389
- $luma: k-color-luminance($color);
390
- $out: if($luma < .5, $light, $dark);
391
- // @debug $luma;
392
- @return $out;
393
- }
@@ -1,134 +0,0 @@
1
- $kendo-light-color-level-step: 8% !default;
2
- $kendo-dark-color-level-step: 16% !default;
3
-
4
- /// Set a specific jump point for requesting color jumps
5
- /// @group color-system
6
- /// @access private
7
- $kendo-color-level-step: 8% !default;
8
-
9
- @function k-color-level( $color, $level: 0 ) {
10
- $_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
11
- $_color-level-step: if( $_dark-theme, $kendo-dark-color-level-step, $kendo-light-color-level-step );
12
-
13
- @if ( $level == 0 ) or ( $level == 0% ) {
14
- @return $color;
15
- }
16
-
17
- $base: if( $level < 0, #ffffff, #000000 );
18
- $level: k-math-abs( $level );
19
-
20
-
21
- @if ( k-math-unit($level) == "%" ) {
22
- @return k-color-mix( $base, $color, $level );
23
- }
24
-
25
- @return k-color-mix( $base, $color, k-math-clamp( $level * $_color-level-step, 0%, 100% ) );
26
- }
27
-
28
- /// Makes a color lighter by mixing it with white
29
- /// @param {Color} $color - The color to lighten
30
- /// @param {Number} $level - The amount to lighten the color
31
- /// @return {Color} - The lightened color
32
- ///
33
- /// @group color-system
34
- ///
35
- /// @example scss - Usage
36
- /// @debug k-color-tint( #f00, 1 ); // => #ff1a1a
37
- @function k-color-tint( $color, $level: 1 ) {
38
- @return k-color-level( $color, -$level );
39
- }
40
-
41
- /// Makes a color darker by mixing it with black
42
- /// @param {Color} $color - The color to darken
43
- /// @param {Number} $level - The amount to darken the color
44
- /// @return {Color} - The darkened color
45
- ///
46
- /// @group color-system
47
- ///
48
- /// @example scss - Usage
49
- /// @debug k-color-shade( #f00, 1 ); // => #e60000
50
- @function k-color-shade( $color, $level: 1 ) {
51
- @return k-color-level( $color, $level );
52
- }
53
-
54
- /// Shades the color in light themes and tints it in dark themes
55
- /// @param {Color} $color - The color to shade or tint
56
- /// @param {Number} $level - The amount to shade or tint the color
57
- /// @return {Color} - The shaded or tinted color
58
- ///
59
- /// @group color-system
60
- @function k-try-shade( $color, $level: 1 ) {
61
- $_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
62
-
63
- @if $_dark-theme {
64
- @return k-color-tint( $color, $level );
65
- }
66
-
67
- @return k-color-shade( $color, $level );
68
- }
69
-
70
- /// Tints the color in light themes and shades it in dark themes
71
- /// @param {Color} $color - The color to tint or shade
72
- /// @param {Number} $level - The amount to tint or shade the color
73
- /// @return {Color} - The tinted or shaded color
74
- ///
75
- /// @group color-system
76
- @function k-try-tint( $color, $level: 1 ) {
77
- $_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
78
-
79
- @if $_dark-theme {
80
- @return k-color-shade( $color, $level );
81
- }
82
-
83
- @return k-color-tint( $color, $level );
84
- }
85
-
86
- /// Darkens the color in light themes and lightens it in dark themes
87
- /// @param {Color} $color - The color to darken or lighten
88
- /// @param {Number} $level - The amount to darken or lighten the color
89
- /// @return {Color} - The darkened or lightened color
90
- ///
91
- /// @group color-system
92
- @function k-try-darken( $color, $amount ) {
93
- $_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
94
-
95
- @if $_dark-theme {
96
- @return k-color-lighten( $color, $amount );
97
- }
98
- @return k-color-darken( $color, $amount );
99
- }
100
-
101
- /// Lightens the color in light themes and darkens it in dark themes
102
- /// @param {Color} $color - The color to lighten or darken
103
- /// @param {Number} $level - The amount to lighten or darken the color
104
- /// @return {Color} - The lightened or darkened color
105
- ///
106
- /// @group color-system
107
- @function k-try-lighten( $color, $amount ) {
108
- $_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
109
-
110
- @if $_dark-theme {
111
- @return k-color-darken( $color, $amount );
112
- }
113
- @return k-color-lighten( $color, $amount );
114
- }
115
-
116
- /// Converts a color with alpha to solid color mixed with a background color
117
- /// @param {Color} $color - The color to convert
118
- /// @param {Color} $bg - The background color
119
- /// @return {Color} - The converted color
120
- ///
121
- /// @group color-system
122
- ///
123
- /// @example scss - Usage
124
- /// @debug k-rgba-to-mix( rgba( #f00, 0.5 ), #fff ); // => #ff8080
125
- @function k-rgba-to-mix( $color, $bg ) {
126
- $percent: k-color-alpha( $color ) * 100%;
127
-
128
- @return k-color-mix( rgba( $color, 1 ), $bg, $percent );
129
- }
130
-
131
- // TODO: Remove this function or rethink the logic
132
- @function k-true-mix( $color1, $color2, $weight: 50% ) {
133
- @return k-color-mix( rgba( $color1, 1 ), rgba( $color2, 1 ), $weight );
134
- }