@progress/kendo-theme-core 5.8.2-dev.4
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/LICENSE.md +17 -0
- package/package.json +41 -0
- package/scss/functions/_color-contrast.import.scss +333 -0
- package/scss/functions/_color-manipulation.import.scss +71 -0
- package/scss/functions/_color.import.scss +23 -0
- package/scss/functions/_list.import.scss +35 -0
- package/scss/functions/_map.import.scss +33 -0
- package/scss/functions/_math.import.scss +95 -0
- package/scss/functions/_meta.import.scss +53 -0
- package/scss/functions/_string.import.scss +46 -0
- package/scss/functions/index.import.scss +8 -0
- package/scss/index.import.scss +0 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Kendo UI Theme Core
|
|
2
|
+
|
|
3
|
+
This package is part of the following suites:
|
|
4
|
+
|
|
5
|
+
* [Kendo UI for Angular](http://www.telerik.com/kendo-angular-ui/)
|
|
6
|
+
* [KendoReact](http://www.telerik.com/kendo-react-ui/)
|
|
7
|
+
* [Kendo UI for jQuery](http://www.telerik.com/kendo-ui)
|
|
8
|
+
* [UI for ASP.NET MVC](http://www.telerik.com/aspnet-mvc)
|
|
9
|
+
* [UI for ASP.NET Core](http://www.telerik.com/aspnet-core-ui)
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
|
|
13
|
+
All available Kendo UI commercial licenses may be obtained at http://www.telerik.com/purchase/kendo-ui.
|
|
14
|
+
|
|
15
|
+
If you do not own a commercial license, the usage of this software shall be governed by the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
|
16
|
+
|
|
17
|
+
*Copyright © 2020 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.*
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@progress/kendo-theme-core",
|
|
3
|
+
"description": "A collection of functions and mixins used for building themes for Kendo UI",
|
|
4
|
+
"version": "5.8.2-dev.4",
|
|
5
|
+
"author": "Progress",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"Kendo UI",
|
|
9
|
+
"Theme",
|
|
10
|
+
"sass functions",
|
|
11
|
+
"sass mixins"
|
|
12
|
+
],
|
|
13
|
+
"main": "dist/index.css",
|
|
14
|
+
"sass": "scss/index.import.scss",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"scss/"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/telerik/kendo-themes/tree/master/packages/core",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/telerik/kendo-themes.git",
|
|
23
|
+
"directory": "packages/core"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/telerik/kendo-themes/issues/new?labels=bug,T:Core&template=bug_report.md"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "sass-build",
|
|
33
|
+
"sass": "sass-build",
|
|
34
|
+
"prepublishOnly": "node ../../scripts/themes-prepublish.js",
|
|
35
|
+
"postpublish": "echo 'no postpublish for core theme'"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"sass-build": "^1.0.0"
|
|
39
|
+
},
|
|
40
|
+
"gitHead": "03c192e0d4c7227c7d8f41b7fefee897888e6218"
|
|
41
|
+
}
|
|
@@ -0,0 +1,333 @@
|
|
|
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
|
+
//
|
|
7
|
+
// Algorithm, for c in 0 to 255:
|
|
8
|
+
// f(c) {
|
|
9
|
+
// c = c / 255;
|
|
10
|
+
// return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
11
|
+
// }
|
|
12
|
+
//
|
|
13
|
+
// This lookup table is needed since there is no `pow` in SASS.
|
|
14
|
+
// stylelint-disable-next-line scss/dollar-variable-default
|
|
15
|
+
$linear-channel-values: (
|
|
16
|
+
0
|
|
17
|
+
.0003035269835488375
|
|
18
|
+
.000607053967097675
|
|
19
|
+
.0009105809506465125
|
|
20
|
+
.00121410793419535
|
|
21
|
+
.0015176349177441874
|
|
22
|
+
.001821161901293025
|
|
23
|
+
.0021246888848418626
|
|
24
|
+
.0024282158683907
|
|
25
|
+
.0027317428519395373
|
|
26
|
+
.003035269835488375
|
|
27
|
+
.003346535763899161
|
|
28
|
+
.003676507324047436
|
|
29
|
+
.004024717018496307
|
|
30
|
+
.004391442037410293
|
|
31
|
+
.004776953480693729
|
|
32
|
+
.005181516702338386
|
|
33
|
+
.005605391624202723
|
|
34
|
+
.006048833022857054
|
|
35
|
+
.006512090792594475
|
|
36
|
+
.006995410187265387
|
|
37
|
+
.007499032043226175
|
|
38
|
+
.008023192985384994
|
|
39
|
+
.008568125618069307
|
|
40
|
+
.009134058702220787
|
|
41
|
+
.00972121732023785
|
|
42
|
+
.010329823029626936
|
|
43
|
+
.010960094006488246
|
|
44
|
+
.011612245179743885
|
|
45
|
+
.012286488356915872
|
|
46
|
+
.012983032342173012
|
|
47
|
+
.013702083047289686
|
|
48
|
+
.014443843596092545
|
|
49
|
+
.01520851442291271
|
|
50
|
+
.01599629336550963
|
|
51
|
+
.016807375752887384
|
|
52
|
+
.017641954488384078
|
|
53
|
+
.018500220128379697
|
|
54
|
+
.019382360956935723
|
|
55
|
+
.0202885630566524
|
|
56
|
+
.021219010376003555
|
|
57
|
+
.022173884793387385
|
|
58
|
+
.02315336617811041
|
|
59
|
+
.024157632448504756
|
|
60
|
+
.02518685962736163
|
|
61
|
+
.026241221894849898
|
|
62
|
+
.027320891639074894
|
|
63
|
+
.028426039504420793
|
|
64
|
+
.0295568344378088
|
|
65
|
+
.030713443732993635
|
|
66
|
+
.03189603307301153
|
|
67
|
+
.033104766570885055
|
|
68
|
+
.03433980680868217
|
|
69
|
+
.03560131487502034
|
|
70
|
+
.03688945040110004
|
|
71
|
+
.0382043715953465
|
|
72
|
+
.03954623527673284
|
|
73
|
+
.04091519690685319
|
|
74
|
+
.042311410620809675
|
|
75
|
+
.043735029256973465
|
|
76
|
+
.04518620438567554
|
|
77
|
+
.046665086336880095
|
|
78
|
+
.04817182422688942
|
|
79
|
+
.04970656598412723
|
|
80
|
+
.05126945837404324
|
|
81
|
+
.052860647023180246
|
|
82
|
+
.05448027644244237
|
|
83
|
+
.05612849004960009
|
|
84
|
+
.05780543019106723
|
|
85
|
+
.0595112381629812
|
|
86
|
+
.06124605423161761
|
|
87
|
+
.06301001765316767
|
|
88
|
+
.06480326669290577
|
|
89
|
+
.06662593864377289
|
|
90
|
+
.06847816984440017
|
|
91
|
+
.07036009569659588
|
|
92
|
+
.07227185068231748
|
|
93
|
+
.07421356838014963
|
|
94
|
+
.07618538148130785
|
|
95
|
+
.07818742180518633
|
|
96
|
+
.08021982031446832
|
|
97
|
+
.0822827071298148
|
|
98
|
+
.08437621154414882
|
|
99
|
+
.08650046203654976
|
|
100
|
+
.08865558628577294
|
|
101
|
+
.09084171118340768
|
|
102
|
+
.09305896284668745
|
|
103
|
+
.0953074666309647
|
|
104
|
+
.09758734714186246
|
|
105
|
+
.09989872824711389
|
|
106
|
+
.10224173308810132
|
|
107
|
+
.10461648409110419
|
|
108
|
+
.10702310297826761
|
|
109
|
+
.10946171077829933
|
|
110
|
+
.1119324278369056
|
|
111
|
+
.11443537382697373
|
|
112
|
+
.11697066775851084
|
|
113
|
+
.11953842798834562
|
|
114
|
+
.12213877222960187
|
|
115
|
+
.12477181756095049
|
|
116
|
+
.12743768043564743
|
|
117
|
+
.1301364766903643
|
|
118
|
+
.13286832155381798
|
|
119
|
+
.13563332965520566
|
|
120
|
+
.13843161503245183
|
|
121
|
+
.14126329114027164
|
|
122
|
+
.14412847085805777
|
|
123
|
+
.14702726649759498
|
|
124
|
+
.14995978981060856
|
|
125
|
+
.15292615199615017
|
|
126
|
+
.1559264637078274
|
|
127
|
+
.1589608350608804
|
|
128
|
+
.162029375639111
|
|
129
|
+
.1651321945016676
|
|
130
|
+
.16826940018969075
|
|
131
|
+
.1714411007328226
|
|
132
|
+
.17464740365558504
|
|
133
|
+
.17788841598362912
|
|
134
|
+
.18116424424986022
|
|
135
|
+
.184474994500441
|
|
136
|
+
.18782077230067787
|
|
137
|
+
.19120168274079138
|
|
138
|
+
.1946178304415758
|
|
139
|
+
.19806931955994886
|
|
140
|
+
.20155625379439707
|
|
141
|
+
.20507873639031693
|
|
142
|
+
.20863687014525575
|
|
143
|
+
.21223075741405523
|
|
144
|
+
.21586050011389926
|
|
145
|
+
.2195261997292692
|
|
146
|
+
.2232279573168085
|
|
147
|
+
.22696587351009836
|
|
148
|
+
.23074004852434915
|
|
149
|
+
.23455058216100522
|
|
150
|
+
.238397573812271
|
|
151
|
+
.24228112246555486
|
|
152
|
+
.24620132670783548
|
|
153
|
+
.25015828472995344
|
|
154
|
+
.25415209433082675
|
|
155
|
+
.2581828529215958
|
|
156
|
+
.26225065752969623
|
|
157
|
+
.26635560480286247
|
|
158
|
+
.2704977910130658
|
|
159
|
+
.27467731206038465
|
|
160
|
+
.2788942634768104
|
|
161
|
+
.2831487404299921
|
|
162
|
+
.2874408377269175
|
|
163
|
+
.29177064981753587
|
|
164
|
+
.2961382707983211
|
|
165
|
+
.3005437944157765
|
|
166
|
+
.3049873140698863
|
|
167
|
+
.30946892281750854
|
|
168
|
+
.31398871337571754
|
|
169
|
+
.31854677812509186
|
|
170
|
+
.32314320911295075
|
|
171
|
+
.3277780980565422
|
|
172
|
+
.33245153634617935
|
|
173
|
+
.33716361504833037
|
|
174
|
+
.3419144249086609
|
|
175
|
+
.3467040563550296
|
|
176
|
+
.35153259950043936
|
|
177
|
+
.3564001441459435
|
|
178
|
+
.3613067797835095
|
|
179
|
+
.3662525955988395
|
|
180
|
+
.3712376804741491
|
|
181
|
+
.3762621229909065
|
|
182
|
+
.38132601143253014
|
|
183
|
+
.386429433787049
|
|
184
|
+
.39157247774972326
|
|
185
|
+
.39675523072562685
|
|
186
|
+
.4019777798321958
|
|
187
|
+
.4072402119017367
|
|
188
|
+
.41254261348390375
|
|
189
|
+
.4178850708481375
|
|
190
|
+
.4232676699860717
|
|
191
|
+
.4286904966139066
|
|
192
|
+
.43415363617474895
|
|
193
|
+
.4396571738409188
|
|
194
|
+
.44520119451622786
|
|
195
|
+
.45078578283822346
|
|
196
|
+
.45641102318040466
|
|
197
|
+
.4620769996544071
|
|
198
|
+
.467783796112159
|
|
199
|
+
.47353149614800955
|
|
200
|
+
.4793201831008268
|
|
201
|
+
.4851499400560704
|
|
202
|
+
.4910208498478356
|
|
203
|
+
.4969329950608704
|
|
204
|
+
.5028864580325687
|
|
205
|
+
.5088813208549338
|
|
206
|
+
.5149176653765214
|
|
207
|
+
.5209955732043543
|
|
208
|
+
.5271151257058131
|
|
209
|
+
.5332764040105052
|
|
210
|
+
.5394794890121072
|
|
211
|
+
.5457244613701866
|
|
212
|
+
.5520114015120001
|
|
213
|
+
.5583403896342679
|
|
214
|
+
.5647115057049292
|
|
215
|
+
.5711248294648731
|
|
216
|
+
.5775804404296506
|
|
217
|
+
.5840784178911641
|
|
218
|
+
.5906188409193369
|
|
219
|
+
.5972017883637634
|
|
220
|
+
.6038273388553378
|
|
221
|
+
.6104955708078648
|
|
222
|
+
.6172065624196511
|
|
223
|
+
.6239603916750761
|
|
224
|
+
.6307571363461468
|
|
225
|
+
.6375968739940326
|
|
226
|
+
.6444796819705821
|
|
227
|
+
.6514056374198242
|
|
228
|
+
.6583748172794485
|
|
229
|
+
.665387298282272
|
|
230
|
+
.6724431569576875
|
|
231
|
+
.6795424696330938
|
|
232
|
+
.6866853124353135
|
|
233
|
+
.6938717612919899
|
|
234
|
+
.7011018919329731
|
|
235
|
+
.7083757798916868
|
|
236
|
+
.7156935005064807
|
|
237
|
+
.7230551289219693
|
|
238
|
+
.7304607400903537
|
|
239
|
+
.7379104087727308
|
|
240
|
+
.7454042095403874
|
|
241
|
+
.7529422167760779
|
|
242
|
+
.7605245046752924
|
|
243
|
+
.768151147247507
|
|
244
|
+
.7758222183174236
|
|
245
|
+
.7835377915261935
|
|
246
|
+
.7912979403326302
|
|
247
|
+
.799102738014409
|
|
248
|
+
.8069522576692516
|
|
249
|
+
.8148465722161012
|
|
250
|
+
.8227857543962835
|
|
251
|
+
.8307698767746546
|
|
252
|
+
.83879901174074
|
|
253
|
+
.846873231509858
|
|
254
|
+
.8549926081242338
|
|
255
|
+
.8631572134541023
|
|
256
|
+
.8713671191987972
|
|
257
|
+
.8796223968878317
|
|
258
|
+
.8879231178819663
|
|
259
|
+
.8962693533742664
|
|
260
|
+
.9046611743911496
|
|
261
|
+
.9130986517934192
|
|
262
|
+
.9215818562772946
|
|
263
|
+
.9301108583754237
|
|
264
|
+
.938685728457888
|
|
265
|
+
.9473065367331999
|
|
266
|
+
.9559733532492861
|
|
267
|
+
.9646862478944651
|
|
268
|
+
.9734452903984125
|
|
269
|
+
.9822505503331171
|
|
270
|
+
.9911020971138298
|
|
271
|
+
1
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
// The contrast ratio to reach against white, to determine if color changes from "light" to "dark".
|
|
275
|
+
// Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
|
|
276
|
+
// See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
|
|
277
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
278
|
+
$wcag-min-contrast-ratio: 7 !default;
|
|
279
|
+
$wcag-dark: black !default;
|
|
280
|
+
$wcag-light: white !default;
|
|
281
|
+
|
|
282
|
+
// Calculate the luminance for a color.
|
|
283
|
+
// See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
|
|
284
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
285
|
+
@function k-color-luminance( $color ) {
|
|
286
|
+
$red: k-list-nth( $linear-channel-values, k-color-red( $color ) + 1 );
|
|
287
|
+
$green: k-list-nth( $linear-channel-values, k-color-green( $color ) + 1 );
|
|
288
|
+
$blue: k-list-nth( $linear-channel-values, k-color-blue( $color ) + 1 );
|
|
289
|
+
|
|
290
|
+
@return .2126 * $red + .7152 * $green + .0722 * $blue;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Calculate the luminance for a color.
|
|
294
|
+
// See https://www.w3.org/TR/WCAG/#dfn-contrast-ratio
|
|
295
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
296
|
+
@function k-color-contrast-ratio( $background, $foreground ) {
|
|
297
|
+
// sass-lint:disable-block variable-name-format
|
|
298
|
+
$backLum: k-color-luminance( $background ) + .05;
|
|
299
|
+
$foreLum: k-color-luminance( $foreground ) + .05;
|
|
300
|
+
|
|
301
|
+
@return k-math-div( k-math-max( $backLum, $foreLum ), k-math-min( $backLum, $foreLum ) );
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@function k-is-dark( $color ) {
|
|
305
|
+
@return if( k-color-luminance( $color ) < .5, true, false );
|
|
306
|
+
}
|
|
307
|
+
@function k-is-light( $color ) {
|
|
308
|
+
@return if( k-color-luminance( $color ) < .5, false, true );
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
// Contrast functions
|
|
313
|
+
@function k-contrast-color( $background, $dark: $wcag-dark, $light: $wcag-light, $min-ratio: $wcag-min-contrast-ratio ) {
|
|
314
|
+
$foregrounds: $light, $dark, #ffffff, #000000;
|
|
315
|
+
$max-ratio: 0;
|
|
316
|
+
$max-ratio-color: null;
|
|
317
|
+
|
|
318
|
+
@each $color in $foregrounds {
|
|
319
|
+
$contrast-ratio: k-color-contrast-ratio( $background, $color );
|
|
320
|
+
|
|
321
|
+
@if ( $contrast-ratio > $min-ratio ) {
|
|
322
|
+
@return $color;
|
|
323
|
+
} @else if ( $contrast-ratio > $max-ratio ) {
|
|
324
|
+
$max-ratio: $contrast-ratio;
|
|
325
|
+
$max-ratio-color: $color;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// sass-lint:disable-block no-warn
|
|
330
|
+
@warn "Found no color leading to #{$min-ratio}:1 contrast ratio against #{$background}...";
|
|
331
|
+
|
|
332
|
+
@return $max-ratio-color;
|
|
333
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// Set a specific jump point for requesting color jumps
|
|
2
|
+
/// @group color-system
|
|
3
|
+
/// @access private
|
|
4
|
+
$kendo-color-level-step: 8% !default;
|
|
5
|
+
|
|
6
|
+
@function k-color-level( $color, $level: 0 ) {
|
|
7
|
+
|
|
8
|
+
@if ( $level == 0 ) or ( $level == 0% ) {
|
|
9
|
+
@return $color;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$base: if( $level < 0, #ffffff, #000000 );
|
|
13
|
+
$level: k-math-abs( $level );
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@if ( k-math-unit($level) == "%" ) {
|
|
17
|
+
@return k-color-mix( $base, $color, $level );
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@return k-color-mix( $base, $color, $level * $kendo-color-level-step );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@function k-color-tint( $color, $level: 1 ) {
|
|
24
|
+
@return k-color-level( $color, -$level );
|
|
25
|
+
}
|
|
26
|
+
@function k-color-shade( $color, $level: 1 ) {
|
|
27
|
+
@return k-color-level( $color, $level );
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@function k-try-shade( $color, $level: 1 ) {
|
|
31
|
+
$dark-theme: if( variable-exists( dark-theme ), $dark-theme, false );
|
|
32
|
+
|
|
33
|
+
@if $dark-theme {
|
|
34
|
+
@return k-color-tint( $color, $level );
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@return k-color-shade( $color, $level );
|
|
38
|
+
}
|
|
39
|
+
@function k-try-tint( $color, $level: 1 ) {
|
|
40
|
+
$dark-theme: if( variable-exists( dark-theme ), $dark-theme, false );
|
|
41
|
+
|
|
42
|
+
@if $dark-theme {
|
|
43
|
+
@return k-color-shade( $color, $level );
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@return k-color-tint( $color, $level );
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@function k-try-darken( $color, $amount ) {
|
|
51
|
+
$dark-theme: if( variable-exists( dark-theme ), $dark-theme, false );
|
|
52
|
+
|
|
53
|
+
@if $dark-theme {
|
|
54
|
+
@return k-color-lighten( $color, $amount );
|
|
55
|
+
}
|
|
56
|
+
@return k-color-darken( $color, $amount );
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@function k-try-lighten( $color, $amount ) {
|
|
60
|
+
$dark-theme: if( variable-exists( dark-theme ), $dark-theme, false );
|
|
61
|
+
|
|
62
|
+
@if $dark-theme {
|
|
63
|
+
@return k-color-darken( $color, $amount );
|
|
64
|
+
}
|
|
65
|
+
@return k-color-lighten( $color, $amount );
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// TODO: Remove this function or rethink the logic
|
|
69
|
+
@function k-true-mix( $color1, $color2, $weight: 50% ) {
|
|
70
|
+
@return k-color-mix( rgba( $color1, 1 ), rgba( $color2, 1 ), $weight );
|
|
71
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@function k-color-red( $color ) {
|
|
2
|
+
@return red( $color );
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function k-color-green( $color ) {
|
|
6
|
+
@return green( $color );
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function k-color-blue( $color ) {
|
|
10
|
+
@return blue( $color );
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@function k-color-mix( $color1, $color2, $weight: 50% ) {
|
|
14
|
+
@return mix( $color1, $color2, $weight );
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@function k-color-darken( $color, $amount) {
|
|
18
|
+
@return darken( $color, $amount );
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@function k-color-lighten( $color, $amount) {
|
|
22
|
+
@return lighten( $color, $amount );
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@function k-list-append( $list, $val, $separator: auto ) {
|
|
2
|
+
@return append( $list, $val, $separator );
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function k-list-index( $list, $value ) {
|
|
6
|
+
@return index( $list, $value );
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function k-list-is-bracketed( $list ) {
|
|
10
|
+
@return is-bracketed( $list );
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@function k-list-join( $list1, $list2, $separator: auto, $bracketed: auto ) {
|
|
14
|
+
@return join( $list1, $list2, $separator, $bracketed );
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@function k-list-length( $list ) {
|
|
18
|
+
@return length( $list );
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@function k-list-nth( $list, $n ) {
|
|
22
|
+
@return nth( $list, $n );
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@function k-list-separator( $list ) {
|
|
26
|
+
@return list-separator( $list );
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@function k-list-set-nth( $list, $n, $value ) {
|
|
30
|
+
@return set-nth( $list, $n, $value );
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@function k-list-zip( $lists... ) {
|
|
34
|
+
@return zip( $lists... );
|
|
35
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@function k-map-get( $map, $keys... ) {
|
|
2
|
+
@each $key in $keys {
|
|
3
|
+
$map: map-get( $map, $key );
|
|
4
|
+
}
|
|
5
|
+
@return $map;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@function k-map-has-key( $map, $key ) {
|
|
9
|
+
@return map-has-key( $map, $key );
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@function k-map-keys( $map ) {
|
|
13
|
+
@return map-keys( $map );
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@function k-map-merge( $map, $args... ) {
|
|
17
|
+
@each $arg in $args {
|
|
18
|
+
$map: map-merge( $map, $arg );
|
|
19
|
+
}
|
|
20
|
+
@return $map;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@function k-map-remove( $map, $keys... ) {
|
|
24
|
+
@return map-remove( $map, $keys... );
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@function k-map-set( $map, $key, $value ) {
|
|
28
|
+
@return k-map-merge( $map, ( $key: $value ) );
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@function k-map-values( $map ) {
|
|
32
|
+
@return map-values( $map );
|
|
33
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@function k-math-abs( $number ) {
|
|
2
|
+
@return abs( $number );
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function k-math-ceil( $number ) {
|
|
6
|
+
@return ceil( $number );
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function k-math-clamp( $value, $min, $max ) {
|
|
10
|
+
@return k-math-max( $min, k-math-min( $max, $value ) );
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@function k-math-compatible( $a, $b ) {
|
|
14
|
+
@return comparable( $a, $b );
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@function k-math-div( $a, $b ) {
|
|
18
|
+
@return ( $a / $b );
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@function k-math-is-unitless( $number ) {
|
|
22
|
+
@return unitless( $number );
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@function k-math-max( $a, $b ) {
|
|
26
|
+
@return max( $a, $b );
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@function k-math-min( $a, $b ) {
|
|
30
|
+
@return min( $a, $b );
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@function k-math-mod( $a, $b ) {
|
|
34
|
+
@return ( $a % $b );
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@function k-math-mul( $a, $b ) {
|
|
38
|
+
@return ( $a * $b );
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@function k-math-percentage( $number ) {
|
|
42
|
+
@return ( $number * 100% );
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@function k-math-pow( $x, $n ) {
|
|
46
|
+
$ret: 1;
|
|
47
|
+
|
|
48
|
+
@if ( $n == 0 ) {
|
|
49
|
+
@return $ret;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@if ( $n > 0 ) {
|
|
53
|
+
@for $i from 1 through $n {
|
|
54
|
+
$ret: $ret * $x;
|
|
55
|
+
}
|
|
56
|
+
@return $ret;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@for $i from $n to 0 {
|
|
60
|
+
$ret: k-math-div( $ret, $x );
|
|
61
|
+
}
|
|
62
|
+
@return $ret;
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@function k-math-random( $limit: null ) {
|
|
67
|
+
@if ( $limit == null ) {
|
|
68
|
+
@return random();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@return random( $limit );
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@function k-math-round( $number, $precision: 0 ) {
|
|
75
|
+
|
|
76
|
+
@if ( $precision == 0 ) {
|
|
77
|
+
@return round( $number );
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
$pow: k-math-pow( 10, $precision );
|
|
81
|
+
|
|
82
|
+
@return k-math-div( round( $number * $pow ), $pow );
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@function k-math-unit( $number ) {
|
|
86
|
+
@return unit( $number );
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@function k-math-strip-unit($number) {
|
|
90
|
+
@if ( k-meta-type-of( $number ) == "number" ) and not k-math-is-unitless( $number ) {
|
|
91
|
+
@return k-math-div( $number, 1 * k-math-unit( $number) );
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@return $number;
|
|
95
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Adapted from https://css-tricks.com/snippets/sass/advanced-type-checking/
|
|
2
|
+
|
|
3
|
+
@function k-meta-type-of( $value ) {
|
|
4
|
+
@return type-of( $value );
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@function k-meta-is-number( $value ) {
|
|
8
|
+
@return k-meta-type-of( $value ) == "number";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@function k-meta-is-integer( $value ) {
|
|
12
|
+
@return k-meta-is-number( $value ) and k-math-round( $value ) == $value;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@function k-meta-is-time( $value ) {
|
|
16
|
+
@return k-meta-is-number( $value ) and k-string-index( "ms" "s", k-math-unit( $value ) ) != null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@function k-meta-is-duration( $value ) {
|
|
20
|
+
@return k-meta-is-time( $value );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@function k-meta-is-angle( $value ) {
|
|
24
|
+
@return k-meta-is-number( $value ) and k-string-index( "deg" "rad" "grad" "turn", k-math-unit( $value ) ) != null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@function k-meta-is-frequency( $value ) {
|
|
28
|
+
@return k-meta-is-number( $value ) and k-string-index( "Hz" "kHz", k-math-unit( $value ) ) != null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@function k-meta-is-relative-length( $value ) {
|
|
32
|
+
@return k-meta-is-number( $value ) and k-string-index( "em" "ex" "ch" "rem" "vw" "vh" "vmin" "vmax", k-math-unit( $value ) ) != null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@function k-meta-is-absolute-length( $value ) {
|
|
36
|
+
@return k-meta-is-number( $value ) and k-string-index( "cm" "mm" "in" "px" "pt" "pc", k-math-unit( $value ) ) != null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@function k-meta-is-percentage( $value ) {
|
|
40
|
+
@return k-meta-is-number( $value ) and k-math-unit( $value ) == "%";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@function k-meta-is-length( $value ) {
|
|
44
|
+
@return k-meta-is-relative-length( $value ) or k-meta-is-absolute-length( $value );
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@function k-meta-is-resolution( $value ) {
|
|
48
|
+
@return k-meta-is-number( $value ) and k-string-index( "dpi" "dpcm" "dppx", k-math-unit( $value ) ) != null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@function k-meta-is-position( $value ) {
|
|
52
|
+
@return k-meta-is-length( $value ) or k-meta-is-percentage( $value ) or k-string-index( "top" "right" "bottom" "left" "center", $value ) != null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@function k-string-index( $string, $substring ) {
|
|
2
|
+
@return str-index( $string, $substring );
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function k-string-insert( $string, $insert, $index ) {
|
|
6
|
+
@return str-insert( $string, $insert, $index );
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function k-string-length( $string ) {
|
|
10
|
+
@return str-length( $string );
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@function k-string-quote( $string ) {
|
|
14
|
+
@return quote( $string );
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// See https://www.sassmeister.com/gist/1b4f2da5527830088e4d
|
|
18
|
+
@function k-string-replace( $string, $search, $replace: "" ) {
|
|
19
|
+
$index: k-string-index( $string, $search );
|
|
20
|
+
|
|
21
|
+
@if $index {
|
|
22
|
+
@return k-string-slice( $string, 1, $index - 1 ) + $replace + k-string-replace( k-string-slice( $string, $index + k-string-length( $search ) ), $search, $replace );
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@return $string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@function k-string-slice( $string, $start-at, $end-at: -1 ) {
|
|
29
|
+
@return str-slice( $string, $start-at, $end-at );
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@function k-string-to-lower-case( $string ) {
|
|
33
|
+
@return to-lower-case( $string );
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@function k-string-to-upper-case( $string ) {
|
|
37
|
+
@return to-upper-case( $string );
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@function k-string-unique-id() {
|
|
41
|
+
@return unique-id();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@function k-string-unquote( $string ) {
|
|
45
|
+
@return unquote( $string );
|
|
46
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@import "_color.import.scss";
|
|
2
|
+
@import "_color-contrast.import.scss";
|
|
3
|
+
@import "_color-manipulation.import.scss";
|
|
4
|
+
@import "_list.import.scss";
|
|
5
|
+
@import "_math.import.scss";
|
|
6
|
+
@import "_map.import.scss";
|
|
7
|
+
@import "_meta.import.scss";
|
|
8
|
+
@import "_string.import.scss";
|
|
File without changes
|