@progress/kendo-theme-core 6.1.1-dev.2 → 6.1.1-dev.25
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.scss +862 -62
- package/dist/meta/sassdoc-data.json +6814 -0
- package/dist/meta/sassdoc-raw-data.json +6754 -0
- package/dist/meta/variables.json +70 -0
- package/dist/meta/variables.scss +10 -0
- package/package.json +2 -2
- package/scss/color-system/_palettes.scss +69 -0
- package/scss/color-system/_variables.scss +37 -0
- package/scss/functions/_color-contrast.import.scss +50 -11
- package/scss/functions/_color-manipulation.import.scss +53 -1
- package/scss/functions/_color.import.scss +105 -0
- package/scss/functions/_escape-string.import.scss +8 -1
- package/scss/functions/_lang.import.scss +11 -0
- package/scss/functions/_list.import.scss +80 -0
- package/scss/functions/_map.import.scss +48 -0
- package/scss/functions/_math.import.scss +131 -9
- package/scss/functions/_meta.import.scss +162 -0
- package/scss/functions/_string.import.scss +69 -1
package/dist/all.scss
CHANGED
|
@@ -1,82 +1,187 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit!
|
|
2
|
-
// baka:source
|
|
2
|
+
// baka:source scss/all.scss
|
|
3
3
|
|
|
4
|
-
// #region @import "./index.import.scss"; ->
|
|
5
|
-
// #region @import "./functions/index.import.scss"; ->
|
|
6
|
-
// #region @import "../_variables.scss"; ->
|
|
4
|
+
// #region @import "./index.import.scss"; -> scss/index.import.scss
|
|
5
|
+
// #region @import "./functions/index.import.scss"; -> scss/functions/index.import.scss
|
|
6
|
+
// #region @import "../_variables.scss"; -> scss/_variables.scss
|
|
7
7
|
// Equilateral triangle variables
|
|
8
8
|
$equilateral-index: 1.7320508076 !default;
|
|
9
9
|
$equilateral-height: .8660254038 !default;
|
|
10
10
|
|
|
11
11
|
// #endregion
|
|
12
12
|
|
|
13
|
-
// #region @import "./_color.import.scss"; ->
|
|
13
|
+
// #region @import "./_color.import.scss"; -> scss/functions/_color.import.scss
|
|
14
|
+
/// Returns the alpha channel of a color.
|
|
15
|
+
/// @param {Color} $color - The color to get the alpha channel for.
|
|
16
|
+
/// @return {Number} - The alpha channel of the color.
|
|
17
|
+
///
|
|
18
|
+
/// @example scss - Usage
|
|
19
|
+
/// @debug k-color-alpha( rgba( 0, 0, 0, 0.5 ) ); // => 0.5
|
|
20
|
+
/// @debug k-color-alpha( #000 ); // => 1
|
|
14
21
|
@function k-color-alpha( $color ) {
|
|
15
22
|
@return alpha( $color );
|
|
16
23
|
}
|
|
17
24
|
|
|
25
|
+
/// Returns the red channel of a color.
|
|
26
|
+
/// @param {Color} $color - The color to get the red channel for.
|
|
27
|
+
/// @return {Number} - The red channel of the color.
|
|
28
|
+
///
|
|
29
|
+
/// @example scss - Usage
|
|
30
|
+
/// @debug k-color-red( #ff0000 ); // => 255
|
|
18
31
|
@function k-color-red( $color ) {
|
|
19
32
|
@return red( $color );
|
|
20
33
|
}
|
|
21
34
|
|
|
35
|
+
/// Returns the green channel of a color.
|
|
36
|
+
/// @param {Color} $color - The color to get the green channel for.
|
|
37
|
+
/// @return {Number} - The green channel of the color.
|
|
38
|
+
///
|
|
39
|
+
/// @example scss - Usage
|
|
40
|
+
/// @debug k-color-green( #00ff00 ); // => 255
|
|
22
41
|
@function k-color-green( $color ) {
|
|
23
42
|
@return green( $color );
|
|
24
43
|
}
|
|
25
44
|
|
|
45
|
+
/// Returns the blue channel of a color.
|
|
46
|
+
/// @param {Color} $color - The color to get the blue channel for.
|
|
47
|
+
/// @return {Number} - The blue channel of the color.
|
|
48
|
+
///
|
|
49
|
+
/// @example scss - Usage
|
|
50
|
+
/// @debug k-color-blue( #0000ff ); // => 255
|
|
26
51
|
@function k-color-blue( $color ) {
|
|
27
52
|
@return blue( $color );
|
|
28
53
|
}
|
|
29
54
|
|
|
55
|
+
/// Returns the hue of a color.
|
|
56
|
+
/// @param {Color} $color - The color to get the hue for.
|
|
57
|
+
/// @return {Number} - The hue of the color.
|
|
58
|
+
///
|
|
59
|
+
/// @example scss - Usage
|
|
60
|
+
/// @debug k-color-hue( #e1d7d2 ); // => 20deg
|
|
30
61
|
@function k-color-hue( $color ) {
|
|
31
62
|
@return hue( $color );
|
|
32
63
|
}
|
|
33
64
|
|
|
65
|
+
/// Returns the saturation of a color.
|
|
66
|
+
/// @param {Color} $color - The color to get the saturation for.
|
|
67
|
+
/// @return {Number} - The saturation of the color.
|
|
68
|
+
///
|
|
69
|
+
/// @example scss - Usage
|
|
70
|
+
/// @debug k-color-saturation( #e1d7d2 ); // => 20%
|
|
34
71
|
@function k-color-saturation( $color ) {
|
|
35
72
|
@return saturation( $color );
|
|
36
73
|
}
|
|
37
74
|
|
|
75
|
+
/// Returns the lightness of a color.
|
|
76
|
+
/// @param {Color} $color - The color to get the lightness for.
|
|
77
|
+
/// @return {Number} - The lightness of the color.
|
|
78
|
+
///
|
|
79
|
+
/// @example scss - Usage
|
|
80
|
+
/// @debug k-color-lightness( #e1d7d2 ); // => 80%
|
|
38
81
|
@function k-color-lightness( $color ) {
|
|
39
82
|
@return lightness( $color );
|
|
40
83
|
}
|
|
41
84
|
|
|
85
|
+
/// Returns a color that is a mix of two colors.
|
|
86
|
+
/// @param {Color} $color1 - The first color.
|
|
87
|
+
/// @param {Color} $color2 - The second color.
|
|
88
|
+
/// @param {Number} $weight - The weight of the first color in the mix.
|
|
89
|
+
/// @return {Color} - The mixed color.
|
|
90
|
+
///
|
|
91
|
+
/// @example scss - Usage
|
|
92
|
+
/// @debug k-color-mix( #f00, #00f ); // => #800080
|
|
42
93
|
@function k-color-mix( $color1, $color2, $weight: 50% ) {
|
|
43
94
|
@return mix( $color1, $color2, $weight );
|
|
44
95
|
}
|
|
45
96
|
|
|
97
|
+
/// Makes a color darker by decreasing its lightness.
|
|
98
|
+
/// @param {Color} $color - The color to darken.
|
|
99
|
+
/// @param {Number} $amount - The amount to darken the color.
|
|
100
|
+
/// @return {Color} - The darkened color.
|
|
101
|
+
///
|
|
102
|
+
/// @example scss - Usage
|
|
103
|
+
/// @debug k-color-darken( #f00, 10% ); // => #e60000
|
|
46
104
|
@function k-color-darken( $color, $amount) {
|
|
47
105
|
@return darken( $color, $amount );
|
|
48
106
|
}
|
|
49
107
|
|
|
108
|
+
/// Makes a color lighter by increasing its lightness.
|
|
109
|
+
/// @param {Color} $color - The color to lighten.
|
|
110
|
+
/// @param {Number} $amount - The amount to lighten the color.
|
|
111
|
+
/// @return {Color} - The lightened color.
|
|
112
|
+
///
|
|
113
|
+
/// @example scss - Usage
|
|
114
|
+
/// @debug k-color-lighten( #f00, 10% ); // => #ff1a1a
|
|
50
115
|
@function k-color-lighten( $color, $amount) {
|
|
51
116
|
@return lighten( $color, $amount );
|
|
52
117
|
}
|
|
53
118
|
|
|
119
|
+
/// Increases or decreases the hue of a color.
|
|
120
|
+
/// @param {Color} $color - The color to adjust the hue for.
|
|
121
|
+
/// @param {Number} $degrees - The amount to adjust the hue.
|
|
122
|
+
/// @return {Color} - The adjusted color.
|
|
123
|
+
///
|
|
124
|
+
/// @example scss - Usage
|
|
125
|
+
/// @debug k-color-adjust-hue( #f00, 10deg ); // => #ff1a00
|
|
54
126
|
@function k-color-adjust-hue( $color, $degrees ) {
|
|
55
127
|
@return adjust-hue( $color, $degrees );
|
|
56
128
|
}
|
|
57
129
|
|
|
130
|
+
/// Increases the saturation of a color.
|
|
131
|
+
/// @param {Color} $color - The color to saturate.
|
|
132
|
+
/// @param {Number} $amount - The amount to saturate the color.
|
|
133
|
+
/// @return {Color} - The saturated color.
|
|
134
|
+
///
|
|
135
|
+
/// @example scss - Usage
|
|
136
|
+
/// @debug k-color-saturate( #f00, 10% ); // => #ff3333
|
|
58
137
|
@function k-color-saturate( $color, $amount ) {
|
|
59
138
|
@return saturate( $color, $amount );
|
|
60
139
|
}
|
|
61
140
|
|
|
141
|
+
/// Decreases the saturation of a color.
|
|
142
|
+
/// @param {Color} $color - The color to desaturate.
|
|
143
|
+
/// @param {Number} $amount - The amount to desaturate the color.
|
|
144
|
+
/// @return {Color} - The desaturated color.
|
|
145
|
+
///
|
|
146
|
+
/// @example scss - Usage
|
|
147
|
+
/// @debug k-color-desaturate( #f00, 10% ); // => #e60000
|
|
62
148
|
@function k-color-desaturate( $color, $amount ) {
|
|
63
149
|
@return desaturate( $color, $amount );
|
|
64
150
|
}
|
|
65
151
|
|
|
152
|
+
/// Returns a gray color with the same lightness as the input color.
|
|
153
|
+
/// @param {Color} $color - The color to convert to grayscale.
|
|
154
|
+
/// @return {Color} - The grayscale color.
|
|
155
|
+
///
|
|
156
|
+
/// @example scss - Usage
|
|
157
|
+
/// @debug k-color-grayscale( #f00 ); // => #808080
|
|
66
158
|
@function k-color-grayscale( $color ) {
|
|
67
159
|
@return grayscale( $color );
|
|
68
160
|
}
|
|
69
161
|
|
|
162
|
+
/// Returns the RGB complement of a color. This identical to adjusting the hue
|
|
163
|
+
/// by 180 degrees.
|
|
164
|
+
/// @param {Color} $color - The color to get the complement for.
|
|
165
|
+
/// @return {Color} - The complement color.
|
|
166
|
+
///
|
|
167
|
+
/// @example scss - Usage
|
|
168
|
+
/// @debug k-color-complement( #f00 ); // => #00ffff
|
|
70
169
|
@function k-color-complement( $color ) {
|
|
71
170
|
@return complement( $color );
|
|
72
171
|
}
|
|
73
172
|
|
|
173
|
+
/// Returns the inverse of a color.
|
|
174
|
+
/// @param {Color} $color - The color to invert.
|
|
175
|
+
/// @return {Color} - The inverted color.
|
|
176
|
+
///
|
|
177
|
+
/// @example scss - Usage
|
|
178
|
+
/// @debug k-color-invert( #f00 ); // => #00ffff
|
|
74
179
|
@function k-color-invert( $color ) {
|
|
75
180
|
@return invert( $color );
|
|
76
181
|
}
|
|
77
182
|
|
|
78
183
|
// #endregion
|
|
79
|
-
// #region @import "./_color-contrast.import.scss"; ->
|
|
184
|
+
// #region @import "./_color-contrast.import.scss"; -> scss/functions/_color-contrast.import.scss
|
|
80
185
|
// Adapted from https://gist.github.com/sgomes/ccc72f71137fe29039c92c0a9fe9b657
|
|
81
186
|
// Adapted from https://github.com/twbs/bootstrap/commit/03908ea37a55eaa44c12ce5694dddc1630c980b3
|
|
82
187
|
|
|
@@ -350,17 +455,31 @@ $_linear-channel-values: (
|
|
|
350
455
|
1
|
|
351
456
|
);
|
|
352
457
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
458
|
+
/// The contrast ratio to reach against white, to determine if color changes from "light" to "dark".
|
|
459
|
+
/// Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
|
|
460
|
+
/// @type Number
|
|
461
|
+
/// @group accessibility
|
|
462
|
+
///
|
|
463
|
+
/// @link https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
|
|
464
|
+
/// @link https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
357
465
|
$wcag-min-contrast-ratio: 7 !default;
|
|
466
|
+
/// Default dark color for WCAG 2.0.
|
|
467
|
+
/// @type Color
|
|
468
|
+
/// @group accessibility
|
|
358
469
|
$wcag-dark: black !default;
|
|
470
|
+
/// Default light color for WCAG 2.0.
|
|
471
|
+
/// @type Color
|
|
472
|
+
/// @group accessibility
|
|
359
473
|
$wcag-light: white !default;
|
|
360
474
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
475
|
+
/// Calculate the relative luminance for a color.
|
|
476
|
+
/// @param {Color} $color - The color to calculate the relative luminance for.
|
|
477
|
+
/// @return {Number} - The relative luminance for the color.
|
|
478
|
+
///
|
|
479
|
+
/// @group accessibility
|
|
480
|
+
///
|
|
481
|
+
/// @link https://www.w3.org/TR/WCAG/#dfn-relative-luminance
|
|
482
|
+
/// @link https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
364
483
|
@function k-color-luminance( $color ) {
|
|
365
484
|
$red: k-list-nth( $_linear-channel-values, k-color-red( $color ) + 1 );
|
|
366
485
|
$green: k-list-nth( $_linear-channel-values, k-color-green( $color ) + 1 );
|
|
@@ -369,9 +488,15 @@ $wcag-light: white !default;
|
|
|
369
488
|
@return .2126 * $red + .7152 * $green + .0722 * $blue;
|
|
370
489
|
}
|
|
371
490
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
491
|
+
/// Calculates contrast ratio between two colors
|
|
492
|
+
/// @param {Color} $background - The background color
|
|
493
|
+
/// @param {Color} $foreground - The foreground color
|
|
494
|
+
/// @return {Number} - The contrast ratio between the two colors
|
|
495
|
+
///
|
|
496
|
+
/// @group accessibility
|
|
497
|
+
///
|
|
498
|
+
/// @link https://www.w3.org/TR/WCAG/#dfn-contrast-ratio
|
|
499
|
+
/// @link https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
375
500
|
@function k-color-contrast-ratio( $background, $foreground ) {
|
|
376
501
|
// sass-lint:disable-block variable-name-format
|
|
377
502
|
$backLum: k-color-luminance( $background ) + .05;
|
|
@@ -380,15 +505,34 @@ $wcag-light: white !default;
|
|
|
380
505
|
@return k-math-div( k-math-max( $backLum, $foreLum ), k-math-min( $backLum, $foreLum ) );
|
|
381
506
|
}
|
|
382
507
|
|
|
508
|
+
/// Checks if a color is dark
|
|
509
|
+
/// @param {Color} $color - The color to check
|
|
510
|
+
/// @return {Boolean} - True if the color is dark, false otherwise
|
|
511
|
+
///
|
|
512
|
+
/// @group accessibility
|
|
383
513
|
@function k-is-dark( $color ) {
|
|
384
514
|
@return if( k-color-luminance( $color ) < .5, true, false );
|
|
385
515
|
}
|
|
516
|
+
|
|
517
|
+
/// Checks if a color is light
|
|
518
|
+
/// @param {Color} $color - The color to check
|
|
519
|
+
/// @return {Boolean} - True if the color is light, false otherwise
|
|
520
|
+
///
|
|
521
|
+
/// @group accessibility
|
|
386
522
|
@function k-is-light( $color ) {
|
|
387
523
|
@return if( k-color-luminance( $color ) < .5, false, true );
|
|
388
524
|
}
|
|
389
525
|
|
|
390
526
|
|
|
391
|
-
|
|
527
|
+
/// Calculates the contrast ratio between a background color and a foreground color.
|
|
528
|
+
/// If the contrast ratio is not high enough, it will return the color with the highest contrast ratio.
|
|
529
|
+
/// @param {Color} $background - The background color
|
|
530
|
+
/// @param {Color} $dark - The dark color to use as a fallback
|
|
531
|
+
/// @param {Color} $light - The light color to use as a fallback
|
|
532
|
+
/// @param {Number} $min-ratio - The minimum contrast ratio to reach
|
|
533
|
+
/// @return {Color} - The color with the highest contrast ratio
|
|
534
|
+
///
|
|
535
|
+
/// @group accessibility
|
|
392
536
|
@function k-contrast-color( $background, $dark: $wcag-dark, $light: $wcag-light, $min-ratio: $wcag-min-contrast-ratio ) {
|
|
393
537
|
$foregrounds: $light, $dark, #ffffff, #000000;
|
|
394
538
|
$max-ratio: 0;
|
|
@@ -436,7 +580,7 @@ $wcag-light: white !default;
|
|
|
436
580
|
}
|
|
437
581
|
|
|
438
582
|
// #endregion
|
|
439
|
-
// #region @import "./_color-manipulation.import.scss"; ->
|
|
583
|
+
// #region @import "./_color-manipulation.import.scss"; -> scss/functions/_color-manipulation.import.scss
|
|
440
584
|
/// Set a specific jump point for requesting color jumps
|
|
441
585
|
/// @group color-system
|
|
442
586
|
/// @access private
|
|
@@ -459,13 +603,38 @@ $kendo-color-level-step: 8% !default;
|
|
|
459
603
|
@return k-color-mix( $base, $color, $level * $kendo-color-level-step );
|
|
460
604
|
}
|
|
461
605
|
|
|
606
|
+
/// Makes a color lighter by mixing it with white
|
|
607
|
+
/// @param {Color} $color - The color to lighten
|
|
608
|
+
/// @param {Number} $level - The amount to lighten the color
|
|
609
|
+
/// @return {Color} - The lightened color
|
|
610
|
+
///
|
|
611
|
+
/// @group color-system
|
|
612
|
+
///
|
|
613
|
+
/// @example scss - Usage
|
|
614
|
+
/// @debug k-color-tint( #f00, 1 ); // => #ff1a1a
|
|
462
615
|
@function k-color-tint( $color, $level: 1 ) {
|
|
463
616
|
@return k-color-level( $color, -$level );
|
|
464
617
|
}
|
|
618
|
+
|
|
619
|
+
/// Makes a color darker by mixing it with black
|
|
620
|
+
/// @param {Color} $color - The color to darken
|
|
621
|
+
/// @param {Number} $level - The amount to darken the color
|
|
622
|
+
/// @return {Color} - The darkened color
|
|
623
|
+
///
|
|
624
|
+
/// @group color-system
|
|
625
|
+
///
|
|
626
|
+
/// @example scss - Usage
|
|
627
|
+
/// @debug k-color-shade( #f00, 1 ); // => #e60000
|
|
465
628
|
@function k-color-shade( $color, $level: 1 ) {
|
|
466
629
|
@return k-color-level( $color, $level );
|
|
467
630
|
}
|
|
468
631
|
|
|
632
|
+
/// Shades the color in light themes and tints it in dark themes
|
|
633
|
+
/// @param {Color} $color - The color to shade or tint
|
|
634
|
+
/// @param {Number} $level - The amount to shade or tint the color
|
|
635
|
+
/// @return {Color} - The shaded or tinted color
|
|
636
|
+
///
|
|
637
|
+
/// @group color-system
|
|
469
638
|
@function k-try-shade( $color, $level: 1 ) {
|
|
470
639
|
$_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
|
|
471
640
|
|
|
@@ -475,6 +644,13 @@ $kendo-color-level-step: 8% !default;
|
|
|
475
644
|
|
|
476
645
|
@return k-color-shade( $color, $level );
|
|
477
646
|
}
|
|
647
|
+
|
|
648
|
+
/// Tints the color in light themes and shades it in dark themes
|
|
649
|
+
/// @param {Color} $color - The color to tint or shade
|
|
650
|
+
/// @param {Number} $level - The amount to tint or shade the color
|
|
651
|
+
/// @return {Color} - The tinted or shaded color
|
|
652
|
+
///
|
|
653
|
+
/// @group color-system
|
|
478
654
|
@function k-try-tint( $color, $level: 1 ) {
|
|
479
655
|
$_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
|
|
480
656
|
|
|
@@ -485,7 +661,12 @@ $kendo-color-level-step: 8% !default;
|
|
|
485
661
|
@return k-color-tint( $color, $level );
|
|
486
662
|
}
|
|
487
663
|
|
|
488
|
-
|
|
664
|
+
/// Darkens the color in light themes and lightens it in dark themes
|
|
665
|
+
/// @param {Color} $color - The color to darken or lighten
|
|
666
|
+
/// @param {Number} $level - The amount to darken or lighten the color
|
|
667
|
+
/// @return {Color} - The darkened or lightened color
|
|
668
|
+
///
|
|
669
|
+
/// @group color-system
|
|
489
670
|
@function k-try-darken( $color, $amount ) {
|
|
490
671
|
$_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
|
|
491
672
|
|
|
@@ -495,6 +676,12 @@ $kendo-color-level-step: 8% !default;
|
|
|
495
676
|
@return k-color-darken( $color, $amount );
|
|
496
677
|
}
|
|
497
678
|
|
|
679
|
+
/// Lightens the color in light themes and darkens it in dark themes
|
|
680
|
+
/// @param {Color} $color - The color to lighten or darken
|
|
681
|
+
/// @param {Number} $level - The amount to lighten or darken the color
|
|
682
|
+
/// @return {Color} - The lightened or darkened color
|
|
683
|
+
///
|
|
684
|
+
/// @group color-system
|
|
498
685
|
@function k-try-lighten( $color, $amount ) {
|
|
499
686
|
$_dark-theme: if( k-meta-variable-exists( kendo-is-dark-theme ), $kendo-is-dark-theme, false );
|
|
500
687
|
|
|
@@ -504,6 +691,15 @@ $kendo-color-level-step: 8% !default;
|
|
|
504
691
|
@return k-color-lighten( $color, $amount );
|
|
505
692
|
}
|
|
506
693
|
|
|
694
|
+
/// Converts a color with alpha to solid color mixed with a background color
|
|
695
|
+
/// @param {Color} $color - The color to convert
|
|
696
|
+
/// @param {Color} $bg - The background color
|
|
697
|
+
/// @return {Color} - The converted color
|
|
698
|
+
///
|
|
699
|
+
/// @group color-system
|
|
700
|
+
///
|
|
701
|
+
/// @example scss - Usage
|
|
702
|
+
/// @debug k-rgba-to-mix( rgba( #f00, 0.5 ), #fff ); // => #ff8080
|
|
507
703
|
@function k-rgba-to-mix( $color, $bg ) {
|
|
508
704
|
$percent: k-color-alpha( $color ) * 100%;
|
|
509
705
|
|
|
@@ -516,7 +712,7 @@ $kendo-color-level-step: 8% !default;
|
|
|
516
712
|
}
|
|
517
713
|
|
|
518
714
|
// #endregion
|
|
519
|
-
// #region @import "./_custom-properties.import.scss"; ->
|
|
715
|
+
// #region @import "./_custom-properties.import.scss"; -> scss/functions/_custom-properties.import.scss
|
|
520
716
|
@function k-var( $prefix: kendo-, $var: null, $fallback: null ) {
|
|
521
717
|
$_prefix: $prefix;
|
|
522
718
|
$_var: $var;
|
|
@@ -556,7 +752,7 @@ $kendo-color-level-step: 8% !default;
|
|
|
556
752
|
}
|
|
557
753
|
|
|
558
754
|
// #endregion
|
|
559
|
-
// #region @import "./_escape-string.import.scss"; ->
|
|
755
|
+
// #region @import "./_escape-string.import.scss"; -> scss/functions/_escape-string.import.scss
|
|
560
756
|
$_kendo-svg-escaped-characters: (
|
|
561
757
|
("%", "%25"),
|
|
562
758
|
("<", "%3c"),
|
|
@@ -566,7 +762,11 @@ $_kendo-svg-escaped-characters: (
|
|
|
566
762
|
(")", "%29")
|
|
567
763
|
) !default;
|
|
568
764
|
|
|
569
|
-
|
|
765
|
+
/// Escapes SVG characters in a string
|
|
766
|
+
/// @param {String} $string - The string to escape
|
|
767
|
+
/// @return {String} - The escaped string
|
|
768
|
+
///
|
|
769
|
+
/// @link https://codepen.io/kevinweber/pen/dXWoRw
|
|
570
770
|
@function k-escape-svg($string) {
|
|
571
771
|
@if k-string-index($string, "data:image/svg+xml") {
|
|
572
772
|
@each $char, $encoded in $_kendo-svg-escaped-characters {
|
|
@@ -589,6 +789,9 @@ $_kendo-escape-class-name: (
|
|
|
589
789
|
"/": "\\/"
|
|
590
790
|
);
|
|
591
791
|
|
|
792
|
+
/// Escapes special characters in a class name
|
|
793
|
+
/// @param {String} $text - The string to escape
|
|
794
|
+
/// @return {String} - The escaped string
|
|
592
795
|
@function k-escape-class-name( $text ) {
|
|
593
796
|
$_text: $text;
|
|
594
797
|
|
|
@@ -600,41 +803,111 @@ $_kendo-escape-class-name: (
|
|
|
600
803
|
}
|
|
601
804
|
|
|
602
805
|
// #endregion
|
|
603
|
-
// #region @import "./_lang.import.scss"; ->
|
|
806
|
+
// #region @import "./_lang.import.scss"; -> scss/functions/_lang.import.scss
|
|
807
|
+
/// Returns the value of a variable if it is not null,
|
|
808
|
+
/// otherwise returns the fallback value.
|
|
809
|
+
/// @param {Any} $var - The variable to check.
|
|
810
|
+
/// @param {Any} $fallback - The fallback value.
|
|
811
|
+
/// @return {Any} - The value of the variable or the fallback value.
|
|
812
|
+
///
|
|
813
|
+
/// @example scss - Usage
|
|
814
|
+
/// $foo: null;
|
|
815
|
+
/// @debug k-if-var( $foo, "bar" ); // => "bar"
|
|
816
|
+
/// $foo: "baz";
|
|
817
|
+
/// @debug k-if-var( $foo, "bar" ); // => "baz"
|
|
604
818
|
@function k-if-var( $var, $fallback ) {
|
|
605
819
|
@return if( $var != null, $var, $fallback );
|
|
606
820
|
}
|
|
607
821
|
|
|
608
822
|
// #endregion
|
|
609
|
-
// #region @import "./_list.import.scss"; ->
|
|
823
|
+
// #region @import "./_list.import.scss"; -> scss/functions/_list.import.scss
|
|
824
|
+
/// Returns a copy of `$list` with `$val` appended to the end.
|
|
825
|
+
/// @param {List} $list - The list to process.
|
|
826
|
+
/// @param {Any} $val - The value to append to `$list`.
|
|
827
|
+
/// @param {String} $separator - The separator to use between `$list` and `$val`.
|
|
828
|
+
/// @return {List} - A copy of `$list` with `$val` appended to the end.
|
|
829
|
+
///
|
|
830
|
+
/// @example scss - Usage
|
|
831
|
+
/// @debug k-list-append( ( "foo", "bar" ), "baz" ); // => "foo, bar, baz"
|
|
610
832
|
@function k-list-append( $list, $val, $separator: auto ) {
|
|
611
833
|
@return append( $list, $val, $separator );
|
|
612
834
|
}
|
|
613
835
|
|
|
836
|
+
/// Checks whether `$list` contains `$value`.
|
|
837
|
+
/// @param {List} $list - The list to check.
|
|
838
|
+
/// @param {Any} $value - The value to check for.
|
|
839
|
+
/// @return {Boolean} - Whether `$list` contains `$value`.
|
|
840
|
+
///
|
|
841
|
+
/// @example scss - Usage
|
|
842
|
+
/// @debug k-list-includes( ( "foo", "bar" ), "foo" ); // => true
|
|
843
|
+
/// @debug k-list-includes( ( "foo", "bar" ), "baz" ); // => false
|
|
614
844
|
@function k-list-includes( $list, $value ) {
|
|
615
845
|
@return k-list-index( $list, $value ) != null;
|
|
616
846
|
}
|
|
617
847
|
|
|
848
|
+
/// Returns the index of `$value` in `$list`.
|
|
849
|
+
/// @param {List} $list - The list to check.
|
|
850
|
+
/// @param {Any} $value - The value to check for.
|
|
851
|
+
/// @return {Number} - The index of `$value` in `$list`.
|
|
852
|
+
///
|
|
853
|
+
/// @example scss - Usage
|
|
854
|
+
/// @debug k-list-index( ( "foo", "bar" ), "foo" ); // => 1
|
|
618
855
|
@function k-list-index( $list, $value ) {
|
|
619
856
|
@return index( $list, $value );
|
|
620
857
|
}
|
|
621
858
|
|
|
859
|
+
/// Returns whether `$list` is bracketed.
|
|
860
|
+
/// @param {List} $list - The list to check.
|
|
861
|
+
/// @return {Boolean} - Whether `$list` is bracketed.
|
|
862
|
+
///
|
|
863
|
+
/// @example scss - Usage
|
|
864
|
+
/// @debug k-list-is-bracketed( ( "foo", "bar" ) ); // => false
|
|
865
|
+
/// @debug k-list-is-bracketed( [ "foo", "bar" ] ); // => true
|
|
622
866
|
@function k-list-is-bracketed( $list ) {
|
|
623
867
|
@return is-bracketed( $list );
|
|
624
868
|
}
|
|
625
869
|
|
|
870
|
+
/// Joins two lists together.
|
|
871
|
+
/// @param {List} $list1 - The first list to join.
|
|
872
|
+
/// @param {List} $list2 - The second list to join.
|
|
873
|
+
/// @param {String} $separator - The separator to use between `$list1` and `$list2`.
|
|
874
|
+
/// @param {Boolean} $bracketed - Whether the result should be bracketed.
|
|
875
|
+
/// @return {List} - The joined list.
|
|
876
|
+
///
|
|
877
|
+
/// @example scss - Usage
|
|
878
|
+
/// @debug k-list-join( ( "foo", "bar" ), ( "baz", "qux" ) ); // => "foo, bar, baz, qux"
|
|
879
|
+
/// @debug k-list-join( ( "foo", "bar" ), ( "baz", "qux" ), " " ); // => "foo bar baz qux"
|
|
626
880
|
@function k-list-join( $list1, $list2, $separator: auto, $bracketed: auto ) {
|
|
627
881
|
@return join( $list1, $list2, $separator, $bracketed );
|
|
628
882
|
}
|
|
629
883
|
|
|
884
|
+
/// Returns the length of `$list`.
|
|
885
|
+
/// @param {List} $list - The list to check.
|
|
886
|
+
/// @return {Number} - The length of `$list`.
|
|
887
|
+
///
|
|
888
|
+
/// @example scss - Usage
|
|
889
|
+
/// @debug k-list-length( ( "foo", "bar" ) ); // => 2
|
|
630
890
|
@function k-list-length( $list ) {
|
|
631
891
|
@return length( $list );
|
|
632
892
|
}
|
|
633
893
|
|
|
894
|
+
/// Returns the nth item in `$list`.
|
|
895
|
+
/// @param {List} $list - The list to check.
|
|
896
|
+
/// @param {Number} $n - The index of the item to return.
|
|
897
|
+
/// @return {Any} - The nth item in `$list`.
|
|
898
|
+
///
|
|
899
|
+
/// @example scss - Usage
|
|
900
|
+
/// @debug k-list-nth( ( "foo", "bar" ), 1 ); // => "foo"
|
|
634
901
|
@function k-list-nth( $list, $n ) {
|
|
635
902
|
@return nth( $list, $n );
|
|
636
903
|
}
|
|
637
904
|
|
|
905
|
+
/// Reverse the order of items in `$list`.
|
|
906
|
+
/// @param {List} $list - The list to reverse.
|
|
907
|
+
/// @return {List} - The reversed list.
|
|
908
|
+
///
|
|
909
|
+
/// @example scss - Usage
|
|
910
|
+
/// @debug k-list-reverse( ( "foo", "bar" ) ); // => "bar, foo"
|
|
638
911
|
@function k-list-reverse( $list: null ) {
|
|
639
912
|
$result: ();
|
|
640
913
|
|
|
@@ -653,64 +926,185 @@ $_kendo-escape-class-name: (
|
|
|
653
926
|
@return $result;
|
|
654
927
|
}
|
|
655
928
|
|
|
929
|
+
/// Returns the separator of `$list`.
|
|
930
|
+
/// @param {List} $list - The list to check.
|
|
931
|
+
/// @return {String} - The separator of `$list`.
|
|
932
|
+
///
|
|
933
|
+
/// @example scss - Usage
|
|
934
|
+
/// @debug k-list-separator( ( "foo", "bar" ) ); // => ","
|
|
656
935
|
@function k-list-separator( $list ) {
|
|
657
936
|
@return list-separator( $list );
|
|
658
937
|
}
|
|
659
938
|
|
|
939
|
+
/// Returns a copy of `$list` with `$val` inserted at `$n`.
|
|
940
|
+
/// @param {List} $list - The list to process.
|
|
941
|
+
/// @param {Number} $n - The index at which to insert `$val`.
|
|
942
|
+
/// @param {Any} $val - The value to insert.
|
|
943
|
+
/// @return {List} - A copy of `$list` with `$val` inserted at `$n`.
|
|
944
|
+
///
|
|
945
|
+
/// @example scss - Usage
|
|
946
|
+
/// @debug k-list-set-nth( ( "foo", "bar" ), 1, "baz" ); // => "baz, bar"
|
|
660
947
|
@function k-list-set-nth( $list, $n, $value ) {
|
|
661
948
|
@return set-nth( $list, $n, $value );
|
|
662
949
|
}
|
|
663
950
|
|
|
951
|
+
/// Combines two lists into a single list of two-item lists.
|
|
952
|
+
/// @param {List} $list1 - The first list to combine.
|
|
953
|
+
/// @param {List} $list2 - The second list to combine.
|
|
954
|
+
/// @return {List} - A list of two-item lists.
|
|
955
|
+
///
|
|
956
|
+
/// @example scss - Usage
|
|
957
|
+
/// @debug k-list-zip( ( "foo", "bar" ), ( "baz", "qux" ) ); // => ((foo, baz), (bar, qux))
|
|
664
958
|
@function k-list-zip( $lists... ) {
|
|
665
959
|
@return zip( $lists... );
|
|
666
960
|
}
|
|
667
961
|
|
|
668
962
|
// #endregion
|
|
669
|
-
// #region @import "./_math.import.scss"; ->
|
|
963
|
+
// #region @import "./_math.import.scss"; -> scss/functions/_math.import.scss
|
|
964
|
+
/// Returns the absolute value of a number.
|
|
965
|
+
/// @param {Number} $number - The number to get the absolute value of.
|
|
966
|
+
/// @return {Number} - The absolute value of `$number`.
|
|
967
|
+
///
|
|
968
|
+
/// @example scss - Usage
|
|
969
|
+
/// @debug k-math-abs( -10 ); // => 10
|
|
670
970
|
@function k-math-abs( $number ) {
|
|
671
971
|
@return abs( $number );
|
|
672
972
|
}
|
|
673
973
|
|
|
974
|
+
/// Returns the smallest integer greater than or equal to a number.
|
|
975
|
+
/// @param {Number} $number - The number to get the ceiling of.
|
|
976
|
+
/// @return {Number} - The ceiling of `$number`.
|
|
977
|
+
///
|
|
978
|
+
/// @example scss - Usage
|
|
979
|
+
/// @debug k-math-ceil( 10.1 ); // => 11
|
|
674
980
|
@function k-math-ceil( $number ) {
|
|
675
981
|
@return ceil( $number );
|
|
676
982
|
}
|
|
677
983
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
|
|
984
|
+
/// Returns the largest integer less than or equal to a number.
|
|
985
|
+
/// @param {Number} $number - The number to get the floor of.
|
|
986
|
+
/// @return {Number} - The floor of `$number`.
|
|
987
|
+
///
|
|
988
|
+
/// @example scss - Usage
|
|
989
|
+
/// @debug k-math-floor( 10.9 ); // => 10
|
|
990
|
+
@function k-math-floor( $number ) {
|
|
991
|
+
@return floor( $number );
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/// Restricts `$number` to the range between `$min` and `$max`. If `$number` is
|
|
995
|
+
/// less than `$min`, `$min` is returned. If `$number` is greater than `$max`,
|
|
996
|
+
/// `$max` is returned. Otherwise, `$number` is returned.
|
|
997
|
+
/// @param {Number} $number - The number to clamp.
|
|
998
|
+
/// @param {Number} $min - The minimum value.
|
|
999
|
+
/// @param {Number} $max - The maximum value.
|
|
1000
|
+
/// @return {Number} - The clamped number.
|
|
1001
|
+
///
|
|
1002
|
+
/// @example scss - Usage
|
|
1003
|
+
/// @debug k-math-clamp( 10, 0, 5 ); // => 5
|
|
1004
|
+
@function k-math-clamp( $number, $min, $max ) {
|
|
1005
|
+
@return k-math-max( $min, k-math-min( $max, $number ) );
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/// Returns whether two numbers have compatible units.
|
|
1009
|
+
/// @param {Number} $a - The first number.
|
|
1010
|
+
/// @param {Number} $b - The second number.
|
|
1011
|
+
/// @return {Boolean} - Whether the numbers have compatible units.
|
|
1012
|
+
///
|
|
1013
|
+
/// @example scss - Usage
|
|
1014
|
+
/// @debug k-math-compatible( 10px, 10px ); // => true
|
|
1015
|
+
/// @debug k-math-compatible( 10px, 10em ); // => false
|
|
682
1016
|
@function k-math-compatible( $a, $b ) {
|
|
683
1017
|
@return comparable( $a, $b );
|
|
684
1018
|
}
|
|
685
1019
|
|
|
1020
|
+
/// Returns the quotient of two numbers.
|
|
1021
|
+
/// @param {Number} $a - The dividend.
|
|
1022
|
+
/// @param {Number} $b - The divisor.
|
|
1023
|
+
/// @return {Number} - The quotient of `$a` and `$b`.
|
|
1024
|
+
///
|
|
1025
|
+
/// @example scss - Usage
|
|
1026
|
+
/// @debug k-math-div( 10, 2 ); // => 5
|
|
1027
|
+
/// @debug k-math-div( 10px, 2 ); // => 5px
|
|
686
1028
|
@function k-math-div( $a, $b ) {
|
|
687
1029
|
@return ( $a / $b );
|
|
688
1030
|
}
|
|
689
1031
|
|
|
1032
|
+
/// Returns whether `$number` has no units.
|
|
1033
|
+
/// @param {Number} $number - The number to check.
|
|
1034
|
+
/// @return {Boolean} - Whether `$number` has no units.
|
|
1035
|
+
///
|
|
1036
|
+
/// @example scss - Usage
|
|
1037
|
+
/// @debug k-math-is-unitless( 10 ); // => true
|
|
1038
|
+
/// @debug k-math-is-unitless( 10px ); // => false
|
|
690
1039
|
@function k-math-is-unitless( $number ) {
|
|
691
1040
|
@return unitless( $number );
|
|
692
1041
|
}
|
|
693
1042
|
|
|
1043
|
+
/// Returns the larger of two numbers.
|
|
1044
|
+
/// @param {Number} $a - The first number.
|
|
1045
|
+
/// @param {Number} $b - The second number.
|
|
1046
|
+
/// @return {Number} - The larger of `$a` and `$b`.
|
|
1047
|
+
///
|
|
1048
|
+
/// @example scss - Usage
|
|
1049
|
+
/// @debug k-math-max( 10, 20 ); // => 20
|
|
1050
|
+
/// @debug k-math-max( 10px, 20px ); // => 20px
|
|
694
1051
|
@function k-math-max( $a, $b ) {
|
|
695
1052
|
@return max( $a, $b );
|
|
696
1053
|
}
|
|
697
1054
|
|
|
1055
|
+
/// Returns the smaller of two numbers.
|
|
1056
|
+
/// @param {Number} $a - The first number.
|
|
1057
|
+
/// @param {Number} $b - The second number.
|
|
1058
|
+
/// @return {Number} - The smaller of `$a` and `$b`.
|
|
1059
|
+
///
|
|
1060
|
+
/// @example scss - Usage
|
|
1061
|
+
/// @debug k-math-min( 10, 20 ); // => 10
|
|
1062
|
+
/// @debug k-math-min( 10px, 20px ); // => 10px
|
|
698
1063
|
@function k-math-min( $a, $b ) {
|
|
699
1064
|
@return min( $a, $b );
|
|
700
1065
|
}
|
|
701
1066
|
|
|
1067
|
+
/// Returns the remainder of two numbers.
|
|
1068
|
+
/// @param {Number} $a - The dividend.
|
|
1069
|
+
/// @param {Number} $b - The divisor.
|
|
1070
|
+
/// @return {Number} - The remainder of `$a` and `$b`.
|
|
1071
|
+
///
|
|
1072
|
+
/// @example scss - Usage
|
|
1073
|
+
/// @debug k-math-mod( 10, 3 ); // => 1
|
|
1074
|
+
/// @debug k-math-mod( 10px, 3 ); // => 1px
|
|
702
1075
|
@function k-math-mod( $a, $b ) {
|
|
703
1076
|
@return ( $a % $b );
|
|
704
1077
|
}
|
|
705
1078
|
|
|
1079
|
+
/// Returns the product of two numbers.
|
|
1080
|
+
/// @param {Number} $a - The first number.
|
|
1081
|
+
/// @param {Number} $b - The second number.
|
|
1082
|
+
/// @return {Number} - The product of `$a` and `$b`.
|
|
1083
|
+
///
|
|
1084
|
+
/// @example scss - Usage
|
|
1085
|
+
/// @debug k-math-mul( 10, 2 ); // => 20
|
|
1086
|
+
/// @debug k-math-mul( 10px, 2 ); // => 20px
|
|
706
1087
|
@function k-math-mul( $a, $b ) {
|
|
707
1088
|
@return ( $a * $b );
|
|
708
1089
|
}
|
|
709
1090
|
|
|
1091
|
+
/// Converts a unitless number to a percentage.
|
|
1092
|
+
/// @param {Number} $number - The number to convert.
|
|
1093
|
+
/// @return {Number} - The percentage.
|
|
1094
|
+
///
|
|
1095
|
+
/// @example scss - Usage
|
|
1096
|
+
/// @debug k-math-percentage( 0.5 ); // => 50%
|
|
710
1097
|
@function k-math-percentage( $number ) {
|
|
711
|
-
@return ( $number
|
|
1098
|
+
@return percentage( $number );
|
|
712
1099
|
}
|
|
713
1100
|
|
|
1101
|
+
/// Returns the result of raising `$x` to the power of `$n`.
|
|
1102
|
+
/// @param {Number} $x - The base.
|
|
1103
|
+
/// @param {Number} $n - The exponent.
|
|
1104
|
+
/// @return {Number} - The result of raising `$x` to the power of `$n`.
|
|
1105
|
+
///
|
|
1106
|
+
/// @example scss - Usage
|
|
1107
|
+
/// @debug k-math-pow( 2, 3 ); // => 8
|
|
714
1108
|
@function k-math-pow( $x, $n ) {
|
|
715
1109
|
$ret: 1;
|
|
716
1110
|
|
|
@@ -732,10 +1126,12 @@ $_kendo-escape-class-name: (
|
|
|
732
1126
|
|
|
733
1127
|
}
|
|
734
1128
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
|
|
1129
|
+
/// Returns a random number between 0 and 1.
|
|
1130
|
+
/// @param {Number} $limit - The upper limit of the random number.
|
|
1131
|
+
/// @return {Number} - A random number between 0 and 1.
|
|
1132
|
+
///
|
|
1133
|
+
/// @example scss - Usage
|
|
1134
|
+
/// @debug k-math-random(); // => 0.123456789
|
|
739
1135
|
@function k-math-random( $limit: null ) {
|
|
740
1136
|
@if ( $limit == null ) {
|
|
741
1137
|
@return random();
|
|
@@ -744,6 +1140,14 @@ $_kendo-escape-class-name: (
|
|
|
744
1140
|
@return random( $limit );
|
|
745
1141
|
}
|
|
746
1142
|
|
|
1143
|
+
/// Returns the result of rounding `$number` to the nearest integer
|
|
1144
|
+
/// using the specified `$precision`.
|
|
1145
|
+
/// @param {Number} $number - The number to round.
|
|
1146
|
+
/// @param {Number} $precision - The number of decimal places to round to.
|
|
1147
|
+
/// @return {Number} - The rounded number.
|
|
1148
|
+
///
|
|
1149
|
+
/// @example scss - Usage
|
|
1150
|
+
/// @debug k-math-round( 10.123456789, 3 ); // => 10.123
|
|
747
1151
|
@function k-math-round( $number, $precision: 0 ) {
|
|
748
1152
|
|
|
749
1153
|
@if ( $precision == 0 ) {
|
|
@@ -755,10 +1159,22 @@ $_kendo-escape-class-name: (
|
|
|
755
1159
|
@return k-math-div( round( $number * $pow ), $pow );
|
|
756
1160
|
}
|
|
757
1161
|
|
|
1162
|
+
/// Returns a string representation of `$number`'s unit.
|
|
1163
|
+
/// @param {Number} $number - The number to get the unit of.
|
|
1164
|
+
/// @return {String} - The unit of `$number`.
|
|
1165
|
+
///
|
|
1166
|
+
/// @example scss - Usage
|
|
1167
|
+
/// @debug k-math-unit( 10px ); // => px
|
|
758
1168
|
@function k-math-unit( $number ) {
|
|
759
1169
|
@return unit( $number );
|
|
760
1170
|
}
|
|
761
1171
|
|
|
1172
|
+
/// Remove the unit from a number.
|
|
1173
|
+
/// @param {Number} $number - The number to remove the unit from.
|
|
1174
|
+
/// @return {Number} - The unitless number.
|
|
1175
|
+
///
|
|
1176
|
+
/// @example scss - Usage
|
|
1177
|
+
/// @debug k-math-strip-unit( 10px ); // => 10
|
|
762
1178
|
@function k-math-strip-unit($number) {
|
|
763
1179
|
@if ( k-meta-type-of( $number ) == "number" ) and not k-math-is-unitless( $number ) {
|
|
764
1180
|
@return k-math-div( $number, 1 * k-math-unit( $number) );
|
|
@@ -768,7 +1184,13 @@ $_kendo-escape-class-name: (
|
|
|
768
1184
|
}
|
|
769
1185
|
|
|
770
1186
|
// #endregion
|
|
771
|
-
// #region @import "./_map.import.scss"; ->
|
|
1187
|
+
// #region @import "./_map.import.scss"; -> scss/functions/_map.import.scss
|
|
1188
|
+
/// Returns the value at `$key` in `$map`.
|
|
1189
|
+
/// @param {Map} $map - The map to get the value from.
|
|
1190
|
+
/// @param {Any} $key - The key to get the value for.
|
|
1191
|
+
///
|
|
1192
|
+
/// @example scss - Usage
|
|
1193
|
+
/// @debug k-map-get( ( "foo": "bar" ), "foo" ); // => "bar"
|
|
772
1194
|
@function k-map-get( $map, $keys... ) {
|
|
773
1195
|
@each $key in $keys {
|
|
774
1196
|
$map: map-get( $map, $key );
|
|
@@ -776,14 +1198,35 @@ $_kendo-escape-class-name: (
|
|
|
776
1198
|
@return $map;
|
|
777
1199
|
}
|
|
778
1200
|
|
|
1201
|
+
/// Returns whether `$map` has a value at `$key`.
|
|
1202
|
+
/// @param {Map} $map - The map to check.
|
|
1203
|
+
/// @param {Any} $key - The key to check.
|
|
1204
|
+
/// @return {Boolean} - Whether `$map` has a value at `$key`.
|
|
1205
|
+
///
|
|
1206
|
+
/// @example scss - Usage
|
|
1207
|
+
/// @debug k-map-has( ( "foo": "bar" ), "foo" ); // => true
|
|
1208
|
+
/// @debug k-map-has( ( "foo": "bar" ), "bar" ); // => false
|
|
779
1209
|
@function k-map-has-key( $map, $key ) {
|
|
780
1210
|
@return map-has-key( $map, $key );
|
|
781
1211
|
}
|
|
782
1212
|
|
|
1213
|
+
/// Returns a comma separated list of the keys in `$map`.
|
|
1214
|
+
/// @param {Map} $map - The map to get the keys from.
|
|
1215
|
+
/// @return {List} - A comma separated list of the keys in `$map`.
|
|
1216
|
+
///
|
|
1217
|
+
/// @example scss - Usage
|
|
1218
|
+
/// @debug k-map-keys( ( "foo": "bar", "baz": "qux" ) ); // => "foo, baz"
|
|
783
1219
|
@function k-map-keys( $map ) {
|
|
784
1220
|
@return map-keys( $map );
|
|
785
1221
|
}
|
|
786
1222
|
|
|
1223
|
+
/// Returns a map with the keys and values from `$map` and `$args`.
|
|
1224
|
+
/// @param {Map} $map - The map to merge.
|
|
1225
|
+
/// @param {Map} $args - The map to merge into `$map`.
|
|
1226
|
+
/// @return {Map} - A map with the keys and values from `$map` and `$args`.
|
|
1227
|
+
///
|
|
1228
|
+
/// @example scss - Usage
|
|
1229
|
+
/// @debug k-map-merge( ( "foo": "bar" ), ( "baz": "qux" ) ); // => ( "foo": "bar", "baz": "qux" )
|
|
787
1230
|
@function k-map-merge( $map, $args... ) {
|
|
788
1231
|
@each $arg in $args {
|
|
789
1232
|
$map: map-merge( $map, $arg );
|
|
@@ -791,117 +1234,337 @@ $_kendo-escape-class-name: (
|
|
|
791
1234
|
@return $map;
|
|
792
1235
|
}
|
|
793
1236
|
|
|
1237
|
+
/// Returns a map with the keys and values from `$map` except for `$keys`.
|
|
1238
|
+
/// @param {Map} $map - The map to remove keys from.
|
|
1239
|
+
/// @param {Any} $keys - The keys to remove from `$map`.
|
|
1240
|
+
/// @return {Map} - A map with the keys and values from `$map` except for `$keys`.
|
|
1241
|
+
///
|
|
1242
|
+
/// @example scss - Usage
|
|
1243
|
+
/// @debug k-map-remove( ( "foo": "bar", "baz": "qux" ), "foo" ); // => ( "baz": "qux" )
|
|
794
1244
|
@function k-map-remove( $map, $keys... ) {
|
|
795
1245
|
@return map-remove( $map, $keys... );
|
|
796
1246
|
}
|
|
797
1247
|
|
|
1248
|
+
/// Sets a single key and value in `$map`.
|
|
1249
|
+
/// @param {Map} $map - The map to set the value in.
|
|
1250
|
+
/// @param {Any} $key - The key to set the value for.
|
|
1251
|
+
/// @param {Any} $value - The value to set.
|
|
1252
|
+
/// @return {Map} - A map with the key and value set.
|
|
1253
|
+
///
|
|
1254
|
+
/// @example scss - Usage
|
|
1255
|
+
/// @debug k-map-set( ( "foo": "bar" ), "baz", "qux" ); // => ( "foo": "bar", "baz": "qux" )
|
|
798
1256
|
@function k-map-set( $map, $key, $value ) {
|
|
799
1257
|
@return k-map-merge( $map, ( $key: $value ) );
|
|
800
1258
|
}
|
|
801
1259
|
|
|
1260
|
+
/// Returns a comma separated list of the values in `$map`.
|
|
1261
|
+
/// @param {Map} $map - The map to get the values from.
|
|
1262
|
+
/// @return {List} - A comma separated list of the values in `$map`.
|
|
1263
|
+
///
|
|
1264
|
+
/// @example scss - Usage
|
|
1265
|
+
/// @debug k-map-values( ( "foo": "bar", "baz": "qux" ) ); // => "bar, qux"
|
|
802
1266
|
@function k-map-values( $map ) {
|
|
803
1267
|
@return map-values( $map );
|
|
804
1268
|
}
|
|
805
1269
|
|
|
806
1270
|
// #endregion
|
|
807
|
-
// #region @import "./_meta.import.scss"; ->
|
|
1271
|
+
// #region @import "./_meta.import.scss"; -> scss/functions/_meta.import.scss
|
|
808
1272
|
// Adapted from https://css-tricks.com/snippets/sass/advanced-type-checking/
|
|
809
1273
|
|
|
1274
|
+
/// A wrapper around the `call()` function.
|
|
1275
|
+
/// Calls the function `$function` with the arguments `$args`.
|
|
1276
|
+
/// @param {Function} $function - The function to call.
|
|
1277
|
+
/// @param {List} $args - The arguments to pass to `$function`.
|
|
1278
|
+
/// @return {Any} - The result of calling `$function` with `$args`.
|
|
1279
|
+
///
|
|
1280
|
+
/// @example scss - Usage
|
|
1281
|
+
/// @debug k-meta-call( k-meta-get-function( "k-string-replace" ), "foo bar", "bar", "baz" ); // => "foo baz"
|
|
810
1282
|
@function k-meta-call( $function, $args... ) {
|
|
811
1283
|
@return call( $function, $args... );
|
|
812
1284
|
}
|
|
813
1285
|
|
|
1286
|
+
/// A wrapper around the `function-exists()` function.
|
|
1287
|
+
/// Returns whether a function with the name `$name` exists.
|
|
1288
|
+
/// @param {String} $name - The name of the function to check.
|
|
1289
|
+
/// @return {Boolean} - Whether a function with the name `$name` exists.
|
|
1290
|
+
///
|
|
1291
|
+
/// @example scss - Usage
|
|
1292
|
+
/// @debug k-meta-function-exists( "k-string-replace" ); // => true
|
|
814
1293
|
@function k-meta-function-exists( $name ) {
|
|
815
1294
|
@return function-exists( $name );
|
|
816
1295
|
}
|
|
817
1296
|
|
|
1297
|
+
/// A wrapper around the `get-function()` function.
|
|
1298
|
+
/// Returns the function with the name `$name`.
|
|
1299
|
+
/// @param {String} $name - The name of the function to get.
|
|
1300
|
+
/// @param {Boolean} $css - Whether to return the CSS representation of the function.
|
|
1301
|
+
/// @param {Module} $module - The module to get the function from.
|
|
1302
|
+
/// @return {Function} - The function with the name `$name`.
|
|
1303
|
+
///
|
|
1304
|
+
/// @example scss - Usage
|
|
1305
|
+
/// @debug k-meta-get-function( "k-string-replace" ); // => Function
|
|
818
1306
|
@function k-meta-get-function( $name, $args... ) {
|
|
819
1307
|
@return get-function( $name, $args... );
|
|
820
1308
|
}
|
|
821
1309
|
|
|
1310
|
+
/// A wrapper around the `inspect()` function.
|
|
1311
|
+
/// Returns a string representation of `$value`.
|
|
1312
|
+
/// @param {Any} $value - The value to inspect.
|
|
1313
|
+
/// @return {String} - A string representation of `$value`.
|
|
1314
|
+
///
|
|
1315
|
+
/// @example scss - Usage
|
|
1316
|
+
/// @debug k-meta-inspect( "foo bar" ); // => "foo bar"
|
|
822
1317
|
@function k-meta-inspect( $value ) {
|
|
823
1318
|
@return inspect( $value );
|
|
824
1319
|
}
|
|
825
1320
|
|
|
1321
|
+
/// A wrapper around the `keywords()` function.
|
|
1322
|
+
/// Returns a map of the keywords in `$args`.
|
|
1323
|
+
/// @param {List} $args - The arguments to process.
|
|
1324
|
+
/// @return {Map} - A map of the keywords in `$args`.
|
|
1325
|
+
///
|
|
1326
|
+
/// @example scss - Usage
|
|
1327
|
+
/// @debug k-meta-keywords( ( "foo" "bar" "baz" "qux" ) ); // => ( "foo": "bar", "baz": "qux" )
|
|
826
1328
|
@function k-meta-keywords( $args ) {
|
|
827
1329
|
@return keywords( $args );
|
|
828
1330
|
}
|
|
829
1331
|
|
|
1332
|
+
/// A wrapper around the `type-of()` function.
|
|
1333
|
+
/// Returns the type of `$value`.
|
|
1334
|
+
/// @param {Any} $value - The value to get the type of.
|
|
1335
|
+
/// @return {String} - The type of `$value`.
|
|
1336
|
+
///
|
|
1337
|
+
/// @example scss - Usage
|
|
1338
|
+
/// @debug k-meta-type-of( "foo bar" ); // => "string"
|
|
830
1339
|
@function k-meta-type-of( $value ) {
|
|
831
1340
|
@return type-of( $value );
|
|
832
1341
|
}
|
|
833
1342
|
|
|
1343
|
+
/// A wrapper around the `variable-exists()` function.
|
|
1344
|
+
/// Returns whether a variable with the name `$name` exists.
|
|
1345
|
+
/// @param {String} $name - The name of the variable to check.
|
|
1346
|
+
/// @return {Boolean} - Whether a variable with the name `$name` exists.
|
|
1347
|
+
///
|
|
1348
|
+
/// @example scss - Usage
|
|
1349
|
+
/// @debug k-meta-variable-exists( "foo" ); // => true
|
|
834
1350
|
@function k-meta-variable-exists( $name ) {
|
|
835
1351
|
@return variable-exists( $name );
|
|
836
1352
|
}
|
|
837
1353
|
|
|
1354
|
+
/// Checks whether `$value` is a <number> CSS data type.
|
|
1355
|
+
/// @param {Any} $value - The value to check.
|
|
1356
|
+
/// @return {Boolean} - Whether `$value` is a number.
|
|
1357
|
+
///
|
|
1358
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/number
|
|
1359
|
+
///
|
|
1360
|
+
/// @example scss - Usage
|
|
1361
|
+
/// @debug k-meta-is-number( 1 ); // => true
|
|
1362
|
+
/// @debug k-meta-is-number( "foo" ); // => false
|
|
838
1363
|
@function k-meta-is-number( $value ) {
|
|
839
1364
|
@return k-meta-type-of( $value ) == "number";
|
|
840
1365
|
}
|
|
841
1366
|
|
|
1367
|
+
/// Checks whether `$value` is a <integer> CSS data type.
|
|
1368
|
+
/// @param {Any} $value - The value to check.
|
|
1369
|
+
/// @return {Boolean} - Whether `$value` is a integer.
|
|
1370
|
+
///
|
|
1371
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/integer
|
|
1372
|
+
///
|
|
1373
|
+
/// @example scss - Usage
|
|
1374
|
+
/// @debug k-meta-is-integer( 1 ); // => true
|
|
1375
|
+
/// @debug k-meta-is-integer( 1.5 ); // => false
|
|
842
1376
|
@function k-meta-is-integer( $value ) {
|
|
843
1377
|
@return k-meta-is-number( $value ) and k-math-round( $value ) == $value;
|
|
844
1378
|
}
|
|
845
1379
|
|
|
1380
|
+
/// Checks whether `$value` is a <time> CSS data type.
|
|
1381
|
+
/// @param {Any} $value - The value to check.
|
|
1382
|
+
/// @return {Boolean} - Whether `$value` is a time.
|
|
1383
|
+
///
|
|
1384
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/time
|
|
1385
|
+
///
|
|
1386
|
+
/// @example scss - Usage
|
|
1387
|
+
/// @debug k-meta-is-time( 1s ); // => true
|
|
1388
|
+
/// @debug k-meta-is-time( 1 ); // => false
|
|
846
1389
|
@function k-meta-is-time( $value ) {
|
|
847
1390
|
@return k-meta-is-number( $value ) and k-string-index( "ms" "s", k-math-unit( $value ) ) != null;
|
|
848
1391
|
}
|
|
849
1392
|
|
|
1393
|
+
/// Checks whether `$value` is a valid duration period.
|
|
1394
|
+
/// @param {Any} $value - The value to check.
|
|
1395
|
+
/// @return {Boolean} - Whether `$value` is a duration.
|
|
1396
|
+
///
|
|
1397
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/time
|
|
1398
|
+
///
|
|
1399
|
+
/// @example scss - Usage
|
|
1400
|
+
/// @debug k-meta-is-duration( 1s ); // => true
|
|
1401
|
+
/// @debug k-meta-is-duration( 1 ); // => false
|
|
850
1402
|
@function k-meta-is-duration( $value ) {
|
|
851
1403
|
@return k-meta-is-time( $value );
|
|
852
1404
|
}
|
|
853
1405
|
|
|
1406
|
+
/// Checks whether `$value` is a <angle> CSS data type.
|
|
1407
|
+
/// @param {Any} $value - The value to check.
|
|
1408
|
+
/// @return {Boolean} - Whether `$value` is a angle.
|
|
1409
|
+
///
|
|
1410
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/angle
|
|
1411
|
+
///
|
|
1412
|
+
/// @example scss - Usage
|
|
1413
|
+
/// @debug k-meta-is-angle( 1deg ); // => true
|
|
1414
|
+
/// @debug k-meta-is-angle( 1 ); // => false
|
|
854
1415
|
@function k-meta-is-angle( $value ) {
|
|
855
1416
|
@return k-meta-is-number( $value ) and k-string-index( "deg" "rad" "grad" "turn", k-math-unit( $value ) ) != null;
|
|
856
1417
|
}
|
|
857
1418
|
|
|
1419
|
+
/// Checks whether `$value` is a <frequency> CSS data type.
|
|
1420
|
+
/// @param {Any} $value - The value to check.
|
|
1421
|
+
/// @return {Boolean} - Whether `$value` is a frequency.
|
|
1422
|
+
///
|
|
1423
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/frequency
|
|
1424
|
+
///
|
|
1425
|
+
/// @example scss - Usage
|
|
1426
|
+
/// @debug k-meta-is-frequency( 1Hz ); // => true
|
|
1427
|
+
/// @debug k-meta-is-frequency( 1 ); // => false
|
|
858
1428
|
@function k-meta-is-frequency( $value ) {
|
|
859
1429
|
@return k-meta-is-number( $value ) and k-string-index( "Hz" "kHz", k-math-unit( $value ) ) != null;
|
|
860
1430
|
}
|
|
861
1431
|
|
|
1432
|
+
/// Checks whether `$value` is a relative <length> CSS data type.
|
|
1433
|
+
/// @param {Any} $value - The value to check.
|
|
1434
|
+
/// @return {Boolean} - Whether `$value` is a relative length.
|
|
1435
|
+
///
|
|
1436
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/length#relative_length_units_based_on_font
|
|
1437
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/length#relative_length_units_based_on_viewport
|
|
1438
|
+
///
|
|
1439
|
+
/// @example scss - Usage
|
|
1440
|
+
/// @debug k-meta-is-relative-length( 1em ); // => true
|
|
1441
|
+
/// @debug k-meta-is-relative-length( 1ch ); // => true
|
|
1442
|
+
/// @debug k-meta-is-relative-length( 1 ); // => false
|
|
862
1443
|
@function k-meta-is-relative-length( $value ) {
|
|
863
1444
|
@return k-meta-is-number( $value ) and k-string-index( "em" "ex" "ch" "rem" "vw" "vh" "vmin" "vmax", k-math-unit( $value ) ) != null;
|
|
864
1445
|
}
|
|
865
1446
|
|
|
1447
|
+
/// Checks whether `$value` is an absolute <length> CSS data type.
|
|
1448
|
+
/// @param {Any} $value - The value to check.
|
|
1449
|
+
/// @return {Boolean} - Whether `$value` is an absolute length.
|
|
1450
|
+
///
|
|
1451
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/length#absolute_length_units
|
|
1452
|
+
///
|
|
1453
|
+
/// @example scss - Usage
|
|
1454
|
+
/// @debug k-meta-is-absolute-length( 1cm ); // => true
|
|
1455
|
+
/// @debug k-meta-is-absolute-length( 1 ); // => false
|
|
866
1456
|
@function k-meta-is-absolute-length( $value ) {
|
|
867
1457
|
@return k-meta-is-number( $value ) and k-string-index( "cm" "mm" "in" "px" "pt" "pc", k-math-unit( $value ) ) != null;
|
|
868
1458
|
}
|
|
869
1459
|
|
|
1460
|
+
/// Checks whether `$value` is a <percentage> CSS data type.
|
|
1461
|
+
/// @param {Any} $value - The value to check.
|
|
1462
|
+
/// @return {Boolean} - Whether `$value` is a percentage.
|
|
1463
|
+
///
|
|
1464
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/percentage
|
|
1465
|
+
///
|
|
1466
|
+
/// @example scss - Usage
|
|
1467
|
+
/// @debug k-meta-is-percentage( 1% ); // => true
|
|
1468
|
+
/// @debug k-meta-is-percentage( 1 ); // => false
|
|
870
1469
|
@function k-meta-is-percentage( $value ) {
|
|
871
1470
|
@return k-meta-is-number( $value ) and k-math-unit( $value ) == "%";
|
|
872
1471
|
}
|
|
873
1472
|
|
|
1473
|
+
/// Checks whether `$value` is a <length> CSS data type.
|
|
1474
|
+
/// @param {Any} $value - The value to check.
|
|
1475
|
+
/// @return {Boolean} - Whether `$value` is a length.
|
|
1476
|
+
///
|
|
1477
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/length
|
|
1478
|
+
///
|
|
1479
|
+
/// @example scss - Usage
|
|
1480
|
+
/// @debug k-meta-is-length( 1em ); // => true
|
|
1481
|
+
/// @debug k-meta-is-length( 1cm ); // => true
|
|
1482
|
+
/// @debug k-meta-is-length( 1 ); // => false
|
|
874
1483
|
@function k-meta-is-length( $value ) {
|
|
875
1484
|
@return k-meta-is-relative-length( $value ) or k-meta-is-absolute-length( $value );
|
|
876
1485
|
}
|
|
877
1486
|
|
|
1487
|
+
/// Checks whether `$value` is a <resolution> CSS data type.
|
|
1488
|
+
/// @param {Any} $value - The value to check.
|
|
1489
|
+
/// @return {Boolean} - Whether `$value` is a resolution.
|
|
1490
|
+
///
|
|
1491
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/resolution
|
|
1492
|
+
///
|
|
1493
|
+
/// @example scss - Usage
|
|
1494
|
+
/// @debug k-meta-is-resolution( 1dpi ); // => true
|
|
1495
|
+
/// @debug k-meta-is-resolution( 1 ); // => false
|
|
878
1496
|
@function k-meta-is-resolution( $value ) {
|
|
879
1497
|
@return k-meta-is-number( $value ) and k-string-index( "dpi" "dpcm" "dppx", k-math-unit( $value ) ) != null;
|
|
880
1498
|
}
|
|
881
1499
|
|
|
1500
|
+
/// Checks whether `$value` is a <position> CSS data type.
|
|
1501
|
+
/// @param {Any} $value - The value to check.
|
|
1502
|
+
/// @return {Boolean} - Whether `$value` is a position.
|
|
1503
|
+
///
|
|
1504
|
+
/// @link https://developer.mozilla.org/en-US/docs/Web/CSS/position
|
|
1505
|
+
///
|
|
1506
|
+
/// @example scss - Usage
|
|
1507
|
+
/// @debug k-meta-is-position( center ); // => true
|
|
882
1508
|
@function k-meta-is-position( $value ) {
|
|
883
1509
|
@return k-meta-is-length( $value ) or k-meta-is-percentage( $value ) or k-string-index( "top" "right" "bottom" "left" "center", $value ) != null;
|
|
884
1510
|
}
|
|
885
1511
|
|
|
886
1512
|
// #endregion
|
|
887
|
-
// #region @import "./_string.import.scss"; ->
|
|
1513
|
+
// #region @import "./_string.import.scss"; -> scss/functions/_string.import.scss
|
|
1514
|
+
/// Returns the first index of `$substring` in `$string`, or `null` if `$string` doesn’t contain `$substring`.
|
|
1515
|
+
/// @param {String} $string - The string to process.
|
|
1516
|
+
/// @param {String} $substring - The substring to look for.
|
|
1517
|
+
/// @return {Number} - The first index of `$substring` in `$string`, or `null` if `$string` doesn’t contain `$substring`.
|
|
1518
|
+
///
|
|
1519
|
+
/// @example scss - Usage
|
|
1520
|
+
/// @debug k-string-index( "foo bar", "bar" ); // => 5
|
|
888
1521
|
@function k-string-index( $string, $substring ) {
|
|
889
1522
|
@return str-index( $string, $substring );
|
|
890
1523
|
}
|
|
891
1524
|
|
|
1525
|
+
/// Returns a copy of `$string` with `$insert` inserted at `$index`.
|
|
1526
|
+
/// @param {String} $string - The string to process.
|
|
1527
|
+
/// @param {String} $insert - The string to insert.
|
|
1528
|
+
/// @param {Number} $index - The index at which to insert `$insert`.
|
|
1529
|
+
/// @return {String} - The resulting string.
|
|
1530
|
+
///
|
|
1531
|
+
/// @example scss - Usage
|
|
1532
|
+
/// @debug k-string-insert( "foo bar", "baz", 5 ); // => "foo baz bar"
|
|
892
1533
|
@function k-string-insert( $string, $insert, $index ) {
|
|
893
1534
|
@return str-insert( $string, $insert, $index );
|
|
894
1535
|
}
|
|
895
1536
|
|
|
1537
|
+
/// Returns the length of `$string`.
|
|
1538
|
+
/// @param {String} $string - The string to process.
|
|
1539
|
+
/// @return {Number} - The length of `$string`.
|
|
1540
|
+
///
|
|
1541
|
+
/// @example scss - Usage
|
|
1542
|
+
/// @debug k-string-length( "foo bar" ); // => 7
|
|
896
1543
|
@function k-string-length( $string ) {
|
|
897
1544
|
@return str-length( $string );
|
|
898
1545
|
}
|
|
899
1546
|
|
|
1547
|
+
/// Returns a copy of `$string` with quotes added.
|
|
1548
|
+
/// @param {String} $string - The string to process.
|
|
1549
|
+
/// @return {String} - The resulting string.
|
|
1550
|
+
///
|
|
1551
|
+
/// @example scss - Usage
|
|
1552
|
+
/// @debug k-string-quote( "foo bar" ); // => "foo bar"
|
|
900
1553
|
@function k-string-quote( $string ) {
|
|
901
1554
|
@return quote( $string );
|
|
902
1555
|
}
|
|
903
1556
|
|
|
904
|
-
|
|
1557
|
+
/// Returns a copy of `$string` with all occurrences of `$search`
|
|
1558
|
+
/// replaced by `$replace`.
|
|
1559
|
+
/// @param {String} $string - The string to process.
|
|
1560
|
+
/// @param {String} $search - The substring to look for.
|
|
1561
|
+
/// @param {String} $replace - The replacement string.
|
|
1562
|
+
/// @return {String} - The resulting string.
|
|
1563
|
+
///
|
|
1564
|
+
/// @link https://www.sassmeister.com/gist/1b4f2da5527830088e4d
|
|
1565
|
+
///
|
|
1566
|
+
/// @example scss - Usage
|
|
1567
|
+
/// @debug k-string-replace( "foo bar", "bar", "baz" ); // => "foo baz"
|
|
905
1568
|
@function k-string-replace( $string, $search, $replace: "" ) {
|
|
906
1569
|
@if k-meta-type-of( $string ) == number {
|
|
907
1570
|
$string: $string + "";
|
|
@@ -916,22 +1579,53 @@ $_kendo-escape-class-name: (
|
|
|
916
1579
|
@return $string;
|
|
917
1580
|
}
|
|
918
1581
|
|
|
1582
|
+
/// Returns a substring of `$string` starting at `$start-at` and ending at `$end-at`.
|
|
1583
|
+
/// @param {String} $string - The string to process.
|
|
1584
|
+
/// @param {Number} $start-at - The index at which to start the substring.
|
|
1585
|
+
/// @param {Number} $end-at - The index at which to end the substring.
|
|
1586
|
+
/// @return {String} - The resulting string.
|
|
1587
|
+
///
|
|
1588
|
+
/// @example scss - Usage
|
|
1589
|
+
/// @debug k-string-slice( "foo bar", 5 ); // => "bar"
|
|
919
1590
|
@function k-string-slice( $string, $start-at, $end-at: -1 ) {
|
|
920
1591
|
@return str-slice( $string, $start-at, $end-at );
|
|
921
1592
|
}
|
|
922
1593
|
|
|
1594
|
+
/// Returns a copy of `$string` with all uppercase letters converted to lowercase.
|
|
1595
|
+
/// @param {String} $string - The string to process.
|
|
1596
|
+
/// @return {String} - The resulting string.
|
|
1597
|
+
///
|
|
1598
|
+
/// @example scss - Usage
|
|
1599
|
+
/// @debug k-string-to-lower-case( "FOO BAR" ); // => "foo bar"
|
|
923
1600
|
@function k-string-to-lower-case( $string ) {
|
|
924
1601
|
@return to-lower-case( $string );
|
|
925
1602
|
}
|
|
926
1603
|
|
|
1604
|
+
/// Returns a copy of `$string` with all lowercase letters converted to uppercase.
|
|
1605
|
+
/// @param {String} $string - The string to process.
|
|
1606
|
+
/// @return {String} - The resulting string.
|
|
1607
|
+
///
|
|
1608
|
+
/// @example scss - Usage
|
|
1609
|
+
/// @debug k-string-to-upper-case( "foo bar" ); // => "FOO BAR"
|
|
927
1610
|
@function k-string-to-upper-case( $string ) {
|
|
928
1611
|
@return to-upper-case( $string );
|
|
929
1612
|
}
|
|
930
1613
|
|
|
1614
|
+
/// Returns a unique identifier.
|
|
1615
|
+
/// @return {String} - The unique identifier.
|
|
1616
|
+
///
|
|
1617
|
+
/// @example scss - Usage
|
|
1618
|
+
/// @debug k-string-unique-id(); // => UNIQUE_ID
|
|
931
1619
|
@function k-string-unique-id() {
|
|
932
1620
|
@return unique-id();
|
|
933
1621
|
}
|
|
934
1622
|
|
|
1623
|
+
/// Returns a copy of `$string` with quotes removed.
|
|
1624
|
+
/// @param {String} $string - The string to process.
|
|
1625
|
+
/// @return {String} - The resulting string.
|
|
1626
|
+
///
|
|
1627
|
+
/// @example scss - Usage
|
|
1628
|
+
/// @debug k-string-unquote( "foo bar" ); // => foo bar
|
|
935
1629
|
@function k-string-unquote( $string ) {
|
|
936
1630
|
@return unquote( $string );
|
|
937
1631
|
}
|
|
@@ -939,8 +1633,8 @@ $_kendo-escape-class-name: (
|
|
|
939
1633
|
// #endregion
|
|
940
1634
|
|
|
941
1635
|
// #endregion
|
|
942
|
-
// #region @import "./color-system/index.import.scss"; ->
|
|
943
|
-
// #region @import "./_functions.import.scss"; ->
|
|
1636
|
+
// #region @import "./color-system/index.import.scss"; -> scss/color-system/index.import.scss
|
|
1637
|
+
// #region @import "./_functions.import.scss"; -> scss/color-system/_functions.import.scss
|
|
944
1638
|
@function k-generate-theme-variant( $variant, $matrix, $src-palette-name ) {
|
|
945
1639
|
$result: ();
|
|
946
1640
|
|
|
@@ -1034,25 +1728,131 @@ $_kendo-escape-class-name: (
|
|
|
1034
1728
|
}
|
|
1035
1729
|
|
|
1036
1730
|
// #endregion
|
|
1037
|
-
// #region @import "./_mixins.import.scss"; ->
|
|
1731
|
+
// #region @import "./_mixins.import.scss"; -> scss/color-system/_mixins.import.scss
|
|
1038
1732
|
|
|
1039
1733
|
// #endregion
|
|
1040
|
-
// #region @import "./_variables.scss"; ->
|
|
1734
|
+
// #region @import "./_variables.scss"; -> scss/color-system/_variables.scss
|
|
1041
1735
|
// Color constants
|
|
1736
|
+
|
|
1737
|
+
/// The color white.
|
|
1738
|
+
/// Note: you cannot change this value.
|
|
1739
|
+
/// @type Color
|
|
1740
|
+
/// @group color-system
|
|
1042
1741
|
$kendo-color-white: #ffffff; // stylelint-disable-line scss/dollar-variable-default
|
|
1742
|
+
|
|
1743
|
+
/// The color black.
|
|
1744
|
+
/// Note: you cannot change this value.
|
|
1745
|
+
/// @type Color
|
|
1746
|
+
/// @group color-system
|
|
1043
1747
|
$kendo-color-black: #000000; // stylelint-disable-line scss/dollar-variable-default
|
|
1044
1748
|
|
|
1749
|
+
/// The color transparent.
|
|
1750
|
+
/// Note: you cannot change this value.
|
|
1751
|
+
/// @type Color
|
|
1752
|
+
/// @group color-system
|
|
1045
1753
|
$kendo-color-rgba-transparent: rgba( 0, 0, 0, 0 ); // stylelint-disable-line scss/dollar-variable-default
|
|
1046
1754
|
|
|
1755
|
+
/// A gradient that goes from transparent to black.
|
|
1756
|
+
/// Note: you cannot change this value.
|
|
1757
|
+
/// @type Gradient
|
|
1758
|
+
/// @group color-system
|
|
1047
1759
|
$kendo-gradient-transparent-to-black: rgba( black, 0 ), black; // stylelint-disable-line scss/dollar-variable-default
|
|
1760
|
+
|
|
1761
|
+
/// A gradient that goes from transparent to white.
|
|
1762
|
+
/// Note: you cannot change this value.
|
|
1763
|
+
/// @type Gradient
|
|
1764
|
+
/// @group color-system
|
|
1048
1765
|
$kendo-gradient-transparent-to-white: rgba( white, 0 ), white; // stylelint-disable-line scss/dollar-variable-default
|
|
1766
|
+
|
|
1767
|
+
/// A gradient that goes from black to transparent.
|
|
1768
|
+
/// Note: you cannot change this value.
|
|
1769
|
+
/// @type Gradient
|
|
1770
|
+
/// @group color-system
|
|
1049
1771
|
$kendo-gradient-black-to-transparent: black, rgba( black, 0 ); // stylelint-disable-line scss/dollar-variable-default
|
|
1772
|
+
|
|
1773
|
+
/// A gradient that goes from white to transparent.
|
|
1774
|
+
/// Note: you cannot change this value.
|
|
1775
|
+
/// @type Gradient
|
|
1776
|
+
/// @group color-system
|
|
1050
1777
|
$kendo-gradient-white-to-transparent: white, rgba( white, 0 ); // stylelint-disable-line scss/dollar-variable-default
|
|
1051
1778
|
|
|
1779
|
+
/// A gradient that cycles through the colors of the rainbow.
|
|
1780
|
+
/// Note: you cannot change this value.
|
|
1781
|
+
/// @type Gradient
|
|
1782
|
+
/// @group color-system
|
|
1052
1783
|
$kendo-gradient-rainbow: #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000; // stylelint-disable-line scss/dollar-variable-default
|
|
1053
1784
|
|
|
1054
1785
|
// #endregion
|
|
1055
|
-
// #region @import "./_palettes.scss"; ->
|
|
1786
|
+
// #region @import "./_palettes.scss"; -> scss/color-system/_palettes.scss
|
|
1787
|
+
/// Color palettes to be used in the Kendo UI themes.
|
|
1788
|
+
/// @access private
|
|
1789
|
+
/// @type Record<String, ColorMap>
|
|
1790
|
+
/// @prop {ColorMap} neutral - The neutral palette
|
|
1791
|
+
/// @prop {ColorMap} marsala - The marsala palette
|
|
1792
|
+
/// @prop {ColorMap} bootstrapGray - The Bootstrap gray palette
|
|
1793
|
+
/// @prop {ColorMap} bootstrapBlue - The Bootstrap blue palette
|
|
1794
|
+
/// @prop {ColorMap} bootstrapIndigo - The Bootstrap indigo palette
|
|
1795
|
+
/// @prop {ColorMap} bootstrapPurple - The Bootstrap purple palette
|
|
1796
|
+
/// @prop {ColorMap} bootstrapPink - The Bootstrap pink palette
|
|
1797
|
+
/// @prop {ColorMap} bootstrapRed - The Bootstrap red palette
|
|
1798
|
+
/// @prop {ColorMap} bootstrapOrange - The Bootstrap orange palette
|
|
1799
|
+
/// @prop {ColorMap} bootstrapYellow - The Bootstrap yellow palette
|
|
1800
|
+
/// @prop {ColorMap} bootstrapGreen - The Bootstrap green palette
|
|
1801
|
+
/// @prop {ColorMap} bootstrapTeal - The Bootstrap teal palette
|
|
1802
|
+
/// @prop {ColorMap} bootstrapCyan - The Bootstrap cyan palette
|
|
1803
|
+
/// @prop {ColorMap} fluentNeutral - The Fluent neutral palette
|
|
1804
|
+
/// @prop {ColorMap} materialGray - The Material gray palette
|
|
1805
|
+
/// @prop {ColorMap} materialBlueGray - The Material blue gray palette
|
|
1806
|
+
/// @prop {ColorMap} materialRed - The Material red palette
|
|
1807
|
+
/// @prop {ColorMap} materialPink - The Material pink palette
|
|
1808
|
+
/// @prop {ColorMap} materialPurple - The Material purple palette
|
|
1809
|
+
/// @prop {ColorMap} materialDeepPurple - The Material deep purple palette
|
|
1810
|
+
/// @prop {ColorMap} materialIndigo - The Material indigo palette
|
|
1811
|
+
/// @prop {ColorMap} materialBlue - The Material blue palette
|
|
1812
|
+
/// @prop {ColorMap} materialLightBlue - The Material light blue palette
|
|
1813
|
+
/// @prop {ColorMap} materialCyan - The Material cyan palette
|
|
1814
|
+
/// @prop {ColorMap} materialTeal - The Material teal palette
|
|
1815
|
+
/// @prop {ColorMap} materialGreen - The Material green palette
|
|
1816
|
+
/// @prop {ColorMap} materialLightGreen - The Material light green palette
|
|
1817
|
+
/// @prop {ColorMap} materialLime - The Material lime palette
|
|
1818
|
+
/// @prop {ColorMap} materialYellow - The Material yellow palette
|
|
1819
|
+
/// @prop {ColorMap} materialAmber - The Material amber palette
|
|
1820
|
+
/// @prop {ColorMap} materialOrange - The Material orange palette
|
|
1821
|
+
/// @prop {ColorMap} materialDeepOrange - The Material deep orange palette
|
|
1822
|
+
/// @prop {ColorMap} materialBrown - The Material brown palette
|
|
1823
|
+
/// @prop {ColorMap} primerGray - The Primer gray palette
|
|
1824
|
+
/// @prop {ColorMap} primerBlue - The Primer blue palette
|
|
1825
|
+
/// @prop {ColorMap} primerGreen - The Primer green palette
|
|
1826
|
+
/// @prop {ColorMap} primerYellow - The Primer yellow palette
|
|
1827
|
+
/// @prop {ColorMap} primerOrange - The Primer orange palette
|
|
1828
|
+
/// @prop {ColorMap} primerRed - The Primer red palette
|
|
1829
|
+
/// @prop {ColorMap} primerPurple - The Primer purple palette
|
|
1830
|
+
/// @prop {ColorMap} primerPink - The Primer pink palette
|
|
1831
|
+
/// @prop {ColorMap} primerCoral - The Primer coral palette
|
|
1832
|
+
/// @prop {ColorMap} tailwindNeutral - The Tailwind neutral palette
|
|
1833
|
+
/// @prop {ColorMap} tailwindSlate - The Tailwind slate palette
|
|
1834
|
+
/// @prop {ColorMap} tailwindGray - The Tailwind gray palette
|
|
1835
|
+
/// @prop {ColorMap} tailwindZinc - The Tailwind zinc palette
|
|
1836
|
+
/// @prop {ColorMap} tailwindStone - The Tailwind stone palette
|
|
1837
|
+
/// @prop {ColorMap} tailwindRed - The Tailwind red palette
|
|
1838
|
+
/// @prop {ColorMap} tailwindOrange - The Tailwind orange palette
|
|
1839
|
+
/// @prop {ColorMap} tailwindAmber - The Tailwind amber palette
|
|
1840
|
+
/// @prop {ColorMap} tailwindYellow - The Tailwind yellow palette
|
|
1841
|
+
/// @prop {ColorMap} tailwindLime - The Tailwind lime palette
|
|
1842
|
+
/// @prop {ColorMap} tailwindGreen - The Tailwind green palette
|
|
1843
|
+
/// @prop {ColorMap} tailwindEmerald - The Tailwind emerald palette
|
|
1844
|
+
/// @prop {ColorMap} tailwindTeal - The Tailwind teal palette
|
|
1845
|
+
/// @prop {ColorMap} tailwindCyan - The Tailwind cyan palette
|
|
1846
|
+
/// @prop {ColorMap} tailwindSky - The Tailwind sky palette
|
|
1847
|
+
/// @prop {ColorMap} tailwindBlue - The Tailwind blue palette
|
|
1848
|
+
/// @prop {ColorMap} tailwindIndigo - The Tailwind indigo palette
|
|
1849
|
+
/// @prop {ColorMap} tailwindViolet - The Tailwind violet palette
|
|
1850
|
+
/// @prop {ColorMap} tailwindPurple - The Tailwind purple palette
|
|
1851
|
+
/// @prop {ColorMap} tailwindFuchsia - The Tailwind fuchsia palette
|
|
1852
|
+
/// @prop {ColorMap} tailwindPink - The Tailwind pink palette
|
|
1853
|
+
/// @prop {ColorMap} tailwindRose - The Tailwind rose palette
|
|
1854
|
+
///
|
|
1855
|
+
/// @group color-system
|
|
1056
1856
|
$kendo-palettes: (
|
|
1057
1857
|
|
|
1058
1858
|
// Kendo
|
|
@@ -1972,8 +2772,8 @@ $kendo-palettes: (
|
|
|
1972
2772
|
// #endregion
|
|
1973
2773
|
|
|
1974
2774
|
// #endregion
|
|
1975
|
-
// #region @import "./mixins/index.import.scss"; ->
|
|
1976
|
-
// #region @import "./_border-radius.scss"; ->
|
|
2775
|
+
// #region @import "./mixins/index.import.scss"; -> scss/mixins/index.import.scss
|
|
2776
|
+
// #region @import "./_border-radius.scss"; -> scss/mixins/_border-radius.scss
|
|
1977
2777
|
// Border radius
|
|
1978
2778
|
@mixin border-radius( $radius: null ) {
|
|
1979
2779
|
@if $kendo-enable-rounded {
|
|
@@ -2034,7 +2834,7 @@ $kendo-palettes: (
|
|
|
2034
2834
|
}
|
|
2035
2835
|
|
|
2036
2836
|
// #endregion
|
|
2037
|
-
// #region @import "./_box-shadow.scss"; ->
|
|
2837
|
+
// #region @import "./_box-shadow.scss"; -> scss/mixins/_box-shadow.scss
|
|
2038
2838
|
@mixin box-shadow( $shadow... ) {
|
|
2039
2839
|
@if $kendo-enable-shadows and k-list-nth($shadow, 1) {
|
|
2040
2840
|
box-shadow: $shadow;
|
|
@@ -2042,7 +2842,7 @@ $kendo-palettes: (
|
|
|
2042
2842
|
}
|
|
2043
2843
|
|
|
2044
2844
|
// #endregion
|
|
2045
|
-
// #region @import "./_data-uri.scss"; ->
|
|
2845
|
+
// #region @import "./_data-uri.scss"; -> scss/mixins/_data-uri.scss
|
|
2046
2846
|
/// A list of files converted to data URIs
|
|
2047
2847
|
/// @access private
|
|
2048
2848
|
$_kendo-data-uris: () !default;
|
|
@@ -2062,7 +2862,7 @@ $_kendo-data-uris: () !default;
|
|
|
2062
2862
|
}
|
|
2063
2863
|
|
|
2064
2864
|
// #endregion
|
|
2065
|
-
// #region @import "./_disabled.scss"; ->
|
|
2865
|
+
// #region @import "./_disabled.scss"; -> scss/mixins/_disabled.scss
|
|
2066
2866
|
// Disabled
|
|
2067
2867
|
@mixin disabled( $kendo-disabled-styling ) {
|
|
2068
2868
|
outline: none;
|
|
@@ -2074,7 +2874,7 @@ $_kendo-data-uris: () !default;
|
|
|
2074
2874
|
}
|
|
2075
2875
|
|
|
2076
2876
|
// #endregion
|
|
2077
|
-
// #region @import "./_focus-indicator.scss"; ->
|
|
2877
|
+
// #region @import "./_focus-indicator.scss"; -> scss/mixins/_focus-indicator.scss
|
|
2078
2878
|
@mixin focus-indicator( $indicator, $inset: false, $themeable: false, $type: "box-shadow" ) {
|
|
2079
2879
|
@if $kendo-enable-focus-contrast and k-list-nth($indicator, 1) {
|
|
2080
2880
|
@include box-shadow( if( $inset, inset, null ) 0 0 0 2px if( $themeable, currentColor, rgb( 0, 0, 0 ) ) );
|
|
@@ -2084,7 +2884,7 @@ $_kendo-data-uris: () !default;
|
|
|
2084
2884
|
}
|
|
2085
2885
|
|
|
2086
2886
|
// #endregion
|
|
2087
|
-
// #region @import "./_gradient.scss"; ->
|
|
2887
|
+
// #region @import "./_gradient.scss"; -> scss/mixins/_gradient.scss
|
|
2088
2888
|
@mixin linear-gradient( $gradient: null ) {
|
|
2089
2889
|
@if $gradient and $kendo-enable-gradients {
|
|
2090
2890
|
@if $gradient == none {
|
|
@@ -2123,7 +2923,7 @@ $_kendo-data-uris: () !default;
|
|
|
2123
2923
|
}
|
|
2124
2924
|
|
|
2125
2925
|
// #endregion
|
|
2126
|
-
// #region @import "./_hide-scrollbar.scss"; ->
|
|
2926
|
+
// #region @import "./_hide-scrollbar.scss"; -> scss/mixins/_hide-scrollbar.scss
|
|
2127
2927
|
$kendo-scrollbar-width: 17px !default;
|
|
2128
2928
|
|
|
2129
2929
|
@mixin hide-scrollbar( $dir: "right", $max-scrollbar: 100px ) {
|
|
@@ -2144,7 +2944,7 @@ $kendo-scrollbar-width: 17px !default;
|
|
|
2144
2944
|
}
|
|
2145
2945
|
|
|
2146
2946
|
// #endregion
|
|
2147
|
-
// #region @import "./_import-once.scss"; ->
|
|
2947
|
+
// #region @import "./_import-once.scss"; -> scss/mixins/_import-once.scss
|
|
2148
2948
|
/// A list of exported modules.
|
|
2149
2949
|
/// @access private
|
|
2150
2950
|
$_kendo-imported-modules: () !default;
|
|
@@ -2161,7 +2961,7 @@ $_kendo-imported-modules: () !default;
|
|
|
2161
2961
|
}
|
|
2162
2962
|
|
|
2163
2963
|
// #endregion
|
|
2164
|
-
// #region @import "./_typography.scss"; ->
|
|
2964
|
+
// #region @import "./_typography.scss"; -> scss/mixins/_typography.scss
|
|
2165
2965
|
@mixin typography( $font-size: null, $font-family: null, $line-height: null, $font-weight: null, $letter-spacing: null ) {
|
|
2166
2966
|
font-size: $font-size;
|
|
2167
2967
|
font-family: $font-family;
|
|
@@ -2186,8 +2986,8 @@ $_kendo-imported-modules: () !default;
|
|
|
2186
2986
|
}
|
|
2187
2987
|
|
|
2188
2988
|
// #endregion
|
|
2189
|
-
// #region @import "./module-system/index.import.scss"; ->
|
|
2190
|
-
// #region @import "./_components.scss"; ->
|
|
2989
|
+
// #region @import "./module-system/index.import.scss"; -> scss/module-system/index.import.scss
|
|
2990
|
+
// #region @import "./_components.scss"; -> scss/module-system/_components.scss
|
|
2191
2991
|
$kendo-components: (
|
|
2192
2992
|
// Typography and utils
|
|
2193
2993
|
"typography",
|
|
@@ -2331,7 +3131,7 @@ $kendo-components: (
|
|
|
2331
3131
|
) !default;
|
|
2332
3132
|
|
|
2333
3133
|
// #endregion
|
|
2334
|
-
// #region @import "./_dependencies.scss"; ->
|
|
3134
|
+
// #region @import "./_dependencies.scss"; -> scss/module-system/_dependencies.scss
|
|
2335
3135
|
$_kendo-dependencies: (
|
|
2336
3136
|
action-sheet: (
|
|
2337
3137
|
"icon",
|
|
@@ -2859,8 +3659,8 @@ $_imported: ();
|
|
|
2859
3659
|
@include verify-dependencies();
|
|
2860
3660
|
|
|
2861
3661
|
// #endregion
|
|
2862
|
-
// #region @import "./styles/index.import.scss"; ->
|
|
2863
|
-
// #region @import "./_accessibility.scss"; ->
|
|
3662
|
+
// #region @import "./styles/index.import.scss"; -> scss/styles/index.import.scss
|
|
3663
|
+
// #region @import "./_accessibility.scss"; -> scss/styles/_accessibility.scss
|
|
2864
3664
|
@mixin kendo-core--styles--accessibility() {
|
|
2865
3665
|
|
|
2866
3666
|
/// This class could be assigned to elements which should be visually hidden, but remain accessible for screen readers.
|
|
@@ -2877,7 +3677,7 @@ $_imported: ();
|
|
|
2877
3677
|
}
|
|
2878
3678
|
|
|
2879
3679
|
// #endregion
|
|
2880
|
-
// #region @import "./_asp-fallback.scss"; ->
|
|
3680
|
+
// #region @import "./_asp-fallback.scss"; -> scss/styles/_asp-fallback.scss
|
|
2881
3681
|
@mixin kendo-core--styles--asp-fallback() {
|
|
2882
3682
|
|
|
2883
3683
|
.k-theme-test-class,
|
|
@@ -2888,7 +3688,7 @@ $_imported: ();
|
|
|
2888
3688
|
}
|
|
2889
3689
|
|
|
2890
3690
|
// #endregion
|
|
2891
|
-
// #region @import "./_layout"; ->
|
|
3691
|
+
// #region @import "./_layout"; -> scss/styles/_layout.scss
|
|
2892
3692
|
@mixin kendo-core--styles--layout() {
|
|
2893
3693
|
|
|
2894
3694
|
// Basic layout
|
|
@@ -2986,7 +3786,7 @@ $_imported: ();
|
|
|
2986
3786
|
}
|
|
2987
3787
|
|
|
2988
3788
|
// #endregion
|
|
2989
|
-
// #region @import "./_normalize.scss"; ->
|
|
3789
|
+
// #region @import "./_normalize.scss"; -> scss/styles/_normalize.scss
|
|
2990
3790
|
@mixin kendo-core--styles--normalize() {
|
|
2991
3791
|
|
|
2992
3792
|
// Hidden attribute
|
|
@@ -3014,7 +3814,7 @@ $_imported: ();
|
|
|
3014
3814
|
}
|
|
3015
3815
|
|
|
3016
3816
|
// #endregion
|
|
3017
|
-
// #region @import "./_variables.scss"; ->
|
|
3817
|
+
// #region @import "./_variables.scss"; -> scss/_variables.scss
|
|
3018
3818
|
// File already imported_once. Skipping output.
|
|
3019
3819
|
// #endregion
|
|
3020
3820
|
|