@appartmint/mint 1.3.0 → 1.3.1
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/package.json +2 -2
- package/src/scss/imports/_index.scss +10 -0
- package/src/scss/imports/components/_backgrounds.scss +38 -0
- package/src/scss/imports/components/_buttons.scss +243 -0
- package/src/scss/imports/components/_cards.scss +259 -0
- package/src/scss/imports/components/_embed.scss +75 -0
- package/src/scss/imports/components/_footer.scss +134 -0
- package/src/scss/imports/components/_header.scss +512 -0
- package/src/scss/imports/components/_image.scss +37 -0
- package/src/scss/imports/components/_index.scss +16 -0
- package/src/scss/imports/components/_recaptcha.scss +17 -0
- package/src/scss/imports/components/_tables.scss +29 -0
- package/src/scss/imports/global/_animations.scss +79 -0
- package/src/scss/imports/global/_aspect.scss +54 -0
- package/src/scss/imports/global/_flex.scss +7 -0
- package/src/scss/imports/global/_global.scss +208 -0
- package/src/scss/imports/global/_grid.scss +153 -0
- package/src/scss/imports/global/_icons.scss +6 -0
- package/src/scss/imports/global/_index.scss +12 -0
- package/src/scss/imports/global/_inputs.scss +135 -0
- package/src/scss/imports/global/_structure.scss +89 -0
- package/src/scss/imports/global/_text.scss +62 -0
- package/src/scss/imports/global/_texture.scss +124 -0
- package/src/scss/imports/global/_themes.scss +174 -0
- package/src/scss/imports/overrides/_amplify.scss +48 -0
- package/src/scss/imports/overrides/_full-calendar.scss +46 -0
- package/src/scss/imports/overrides/_index.scss +11 -0
- package/src/scss/imports/overrides/_material.scss +24 -0
- package/src/scss/imports/overrides/_swiper.scss +55 -0
- package/src/scss/imports/util/_index.scss +9 -0
- package/src/scss/imports/util/_util.scss +1034 -0
- package/src/scss/imports/util/_vars.scss +262 -0
- package/src/scss/mint.scss +7 -0
- package/src/scss/noscript.scss +14 -0
|
@@ -0,0 +1,1034 @@
|
|
|
1
|
+
/// _util.scss - Variables, Functions, and Mixins to import elsewhere
|
|
2
|
+
/// @author App Art Mint LLC
|
|
3
|
+
///
|
|
4
|
+
/// @group Util
|
|
5
|
+
|
|
6
|
+
/// Imports
|
|
7
|
+
@use 'sass:color';
|
|
8
|
+
@use 'sass:math';
|
|
9
|
+
@use 'sass:string';
|
|
10
|
+
|
|
11
|
+
/// Library name
|
|
12
|
+
/// @group Variables
|
|
13
|
+
/// @type String
|
|
14
|
+
$lib: mint !default;
|
|
15
|
+
|
|
16
|
+
/// Dash - variable name separator
|
|
17
|
+
/// @group Variables
|
|
18
|
+
/// @type String
|
|
19
|
+
$dash: #{'-'};
|
|
20
|
+
|
|
21
|
+
/// Prefix added to selectors
|
|
22
|
+
/// @group Variables
|
|
23
|
+
/// @type String
|
|
24
|
+
$pre: #{$lib}#{$dash};
|
|
25
|
+
|
|
26
|
+
/// Dot - added to classes
|
|
27
|
+
/// @group Variables
|
|
28
|
+
/// @type String
|
|
29
|
+
$dot: #{'.'};
|
|
30
|
+
|
|
31
|
+
/// Hash - added to ids
|
|
32
|
+
/// @group Variables
|
|
33
|
+
/// @type String
|
|
34
|
+
$hash: #{'#'};
|
|
35
|
+
|
|
36
|
+
/// CSS-selector for disabled elements
|
|
37
|
+
/// @group Variables
|
|
38
|
+
/// @type String
|
|
39
|
+
$disabled: #{'[disabled]'};
|
|
40
|
+
|
|
41
|
+
/// CSS-selector for elements with an aria-controls attribute
|
|
42
|
+
/// @group Variables
|
|
43
|
+
/// @type String
|
|
44
|
+
$has-controls: #{'[aria-controls]'};
|
|
45
|
+
|
|
46
|
+
/// CSS-selector for elements with an aria-expanded attribute
|
|
47
|
+
/// @group Variables
|
|
48
|
+
/// @type String
|
|
49
|
+
$has-expanded: #{'[aria-expanded]'};
|
|
50
|
+
|
|
51
|
+
/// CSS-selector for elements with an aria-hidden attribute
|
|
52
|
+
/// @group Variables
|
|
53
|
+
/// @type String
|
|
54
|
+
$has-hidden: #{'[aria-hidden]'};
|
|
55
|
+
|
|
56
|
+
/// CSS-selector for elements with an href attribute
|
|
57
|
+
/// @group Variables
|
|
58
|
+
/// @type String
|
|
59
|
+
$has-link: #{'[href]'};
|
|
60
|
+
|
|
61
|
+
/// CSS-selector for elements with a routerLink attribute
|
|
62
|
+
/// @group Variables
|
|
63
|
+
/// @type String
|
|
64
|
+
$has-router-link: #{'[routerLink]'};
|
|
65
|
+
|
|
66
|
+
/// CSS-selector for elements with an id attribute
|
|
67
|
+
/// @group Variables
|
|
68
|
+
/// @type String
|
|
69
|
+
$has-id: #{'[id]'};
|
|
70
|
+
|
|
71
|
+
/// CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
|
|
72
|
+
/// @group Variables
|
|
73
|
+
/// @type String
|
|
74
|
+
$not-tabbable: #{'[tabindex^="-"]'};
|
|
75
|
+
|
|
76
|
+
/// CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
|
|
77
|
+
/// @group Variables
|
|
78
|
+
/// @type String
|
|
79
|
+
$tabbable: #{'[tabindex]'}#{neg($not-tabbable)};
|
|
80
|
+
|
|
81
|
+
/// CSS-selector for submenu buttons
|
|
82
|
+
/// @group Variables
|
|
83
|
+
/// @type String
|
|
84
|
+
$sub-menu-buttons: #{'button'}#{$has-controls};
|
|
85
|
+
|
|
86
|
+
/// CSS-selector for submenus
|
|
87
|
+
/// @group Variables
|
|
88
|
+
/// @type String
|
|
89
|
+
$sub-menu: #{$sub-menu-buttons}#{' + ul'}#{$has-id};
|
|
90
|
+
|
|
91
|
+
/// Value added to all delay variables
|
|
92
|
+
/// @group Variables
|
|
93
|
+
/// @type Number
|
|
94
|
+
$delay-base: 0 !default;
|
|
95
|
+
|
|
96
|
+
/// Value added to all delay variables
|
|
97
|
+
/// @group Variables
|
|
98
|
+
/// @type Number
|
|
99
|
+
$delay-step: 100 !default;
|
|
100
|
+
|
|
101
|
+
/// Delay variables
|
|
102
|
+
/// @group Maps
|
|
103
|
+
/// @prop {Number} $delay.instant [0] - Instant: the quickest delay; close or equal to 0
|
|
104
|
+
/// @prop {Number} $delay.fast [100] - Fast: delays that happen quickly
|
|
105
|
+
/// @prop {Number} $delay.med-fast [200] - Med-Fast: delays that happen faster
|
|
106
|
+
/// @prop {Number} $delay.default [300] - Default: delays that are average
|
|
107
|
+
/// @prop {Number} $delay.med-slow [400] - Med-Slow: delays that happen slower
|
|
108
|
+
/// @prop {Number} $delay.slow [500] - Slow: delays that happen slowly
|
|
109
|
+
$delay: (
|
|
110
|
+
instant: $delay-base + $delay-step * 0,
|
|
111
|
+
fast: $delay-base + $delay-step * 1,
|
|
112
|
+
med-fast: $delay-base + $delay-step * 2,
|
|
113
|
+
default: $delay-base + $delay-step * 3,
|
|
114
|
+
med-slow: $delay-base + $delay-step * 4,
|
|
115
|
+
slow: $delay-base + $delay-step * 5
|
|
116
|
+
) !default;
|
|
117
|
+
|
|
118
|
+
/// Breakpoint variables
|
|
119
|
+
/// @group Maps
|
|
120
|
+
/// @prop {Number} $break.xs [480] - Extra-Small: mobile devices
|
|
121
|
+
/// @prop {Number} $break.sm [768] - Small: small tablets, landscape mobiles
|
|
122
|
+
/// @prop {Number} $break.md [1024] - Medium: small desktops, large tablets
|
|
123
|
+
/// @prop {Number} $break.lg [1200] - Large: large desktops, landscape tablets
|
|
124
|
+
/// @prop {Number} $break.xl [1440] - Extra-Large: larger desktops
|
|
125
|
+
$break: (
|
|
126
|
+
xs: 480,
|
|
127
|
+
sm: 768,
|
|
128
|
+
md: 1024,
|
|
129
|
+
lg: 1200,
|
|
130
|
+
xl: 1440
|
|
131
|
+
) !default;
|
|
132
|
+
|
|
133
|
+
/// True if Bootstrap5 is used in the project
|
|
134
|
+
/// @group Variables
|
|
135
|
+
/// @type Boolean
|
|
136
|
+
$bootstrap5: false !default;
|
|
137
|
+
|
|
138
|
+
@if ($bootstrap5) {
|
|
139
|
+
$break: (
|
|
140
|
+
sm: 576,
|
|
141
|
+
md: 768,
|
|
142
|
+
lg: 992,
|
|
143
|
+
xl: 1200,
|
|
144
|
+
xxl: 1400
|
|
145
|
+
) !default;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/// Prefixes the provided string with the library name if it isn't already
|
|
149
|
+
/// @group Functions
|
|
150
|
+
///
|
|
151
|
+
/// @example scss - prefix function
|
|
152
|
+
/// prefix(header) // -> sun-header
|
|
153
|
+
///
|
|
154
|
+
/// @param {String} $base - the string to be prefixed
|
|
155
|
+
/// @return {String} - a prefixed string
|
|
156
|
+
@function prefix ($base) {
|
|
157
|
+
@if (type-of($base) != 'string') {
|
|
158
|
+
@error 'The prefix function requires a string value.';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
$base: string.to-lower-case($base);
|
|
162
|
+
|
|
163
|
+
@if (string.index($base, $pre) != 1) {
|
|
164
|
+
$base: #{$pre}#{$base};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@return $base;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/// Prefixes the provided string with two dashes and the library name if it isn't already
|
|
171
|
+
/// @group Functions
|
|
172
|
+
///
|
|
173
|
+
/// @example scss - css-prefix function
|
|
174
|
+
/// css-prefix(background) // -> --sun-background
|
|
175
|
+
///
|
|
176
|
+
/// @param {String} $base - the string to be prefixed
|
|
177
|
+
/// @return {String} - a prefixed string
|
|
178
|
+
@function css-prefix ($base) {
|
|
179
|
+
@if (type-of($base) != 'string') {
|
|
180
|
+
@error 'The css-prefix function requires a string value.';
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@while (string.index($base, $dash) == 1) {
|
|
184
|
+
$base: string.slice($base, 2);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@return #{$dash}#{$dash}#{prefix($base)};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/// Creates a CSS-var call for the prefixed `$base`
|
|
191
|
+
/// @group Functions
|
|
192
|
+
///
|
|
193
|
+
/// @example scss - css-var function
|
|
194
|
+
/// css-var(background) // -> var(--sun-background)
|
|
195
|
+
///
|
|
196
|
+
/// @param {String} $base - the CSS-var to create a call for
|
|
197
|
+
/// @return {String} - a CSS-var call
|
|
198
|
+
@function css-var ($base) {
|
|
199
|
+
@if (type-of($base) != 'string') {
|
|
200
|
+
@error 'The css-var function requires a string value.';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@if (string.index($base, '--') != 1) {
|
|
204
|
+
$base: css-prefix($base);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@return var(#{$base});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/// Negates a provided CSS-selector
|
|
211
|
+
/// @group Functions
|
|
212
|
+
///
|
|
213
|
+
/// @example scss - neg function
|
|
214
|
+
/// neg(.sun-open) // -> :not(.sun-open)
|
|
215
|
+
///
|
|
216
|
+
/// @param {String} $base - the CSS-selector to negate
|
|
217
|
+
/// @return {String} - a negated CSS-selector
|
|
218
|
+
@function neg ($base) {
|
|
219
|
+
@if (type-of($base) != 'string') {
|
|
220
|
+
@error 'The neg function requires a string value.';
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@return ':not(#{$base})';
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/// Creates a class selector with the library prefix
|
|
227
|
+
/// @group Functions
|
|
228
|
+
///
|
|
229
|
+
/// @example scss - class function
|
|
230
|
+
/// class(open) // -> .sun-open
|
|
231
|
+
///
|
|
232
|
+
/// @param {String} $base - the name of the class
|
|
233
|
+
/// @return {String} - a class selector
|
|
234
|
+
@function class($base) {
|
|
235
|
+
@if (type-of($base) != 'string') {
|
|
236
|
+
@error 'The class function requires a string value.';
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@return #{$dot}#{prefix($base)};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/// Creates an id selector with the library prefix
|
|
243
|
+
/// @group Functions
|
|
244
|
+
///
|
|
245
|
+
/// @example scss - id function
|
|
246
|
+
/// id(header) // -> #sun-header
|
|
247
|
+
///
|
|
248
|
+
/// @param {String} $base - the name of the id
|
|
249
|
+
/// @param {String} $op - the comparison operator
|
|
250
|
+
/// @return {String} - an id selector
|
|
251
|
+
@function id ($base, $op: '=') {
|
|
252
|
+
@if (type-of($base) != 'string') {
|
|
253
|
+
@error 'The id function requires a string value.';
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@if (type-of($op) != 'string') {
|
|
257
|
+
@error 'The controls function requires a string value for param 2.';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@if not($op == '=' or $op == '~=' or $op == '|=' or $op == '^=' or $op == '$=' or $op == '*=') {
|
|
261
|
+
@error 'The controls function requires a valid attribute comparison operator for param 2.';
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@if ($op == '=') {
|
|
265
|
+
@return #{$hash}#{prefix($base)};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@return '[id#{$op}#{prefix($base)}]';
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/// Creates an aria-controls selector with the library prefix
|
|
272
|
+
/// @group Functions
|
|
273
|
+
///
|
|
274
|
+
/// @example scss - controls function
|
|
275
|
+
/// controls(header) // -> [aria-controls=sun-header]
|
|
276
|
+
///
|
|
277
|
+
/// @param {String} $id - the id of the controlled element
|
|
278
|
+
/// @param {String} $op - the comparison operator
|
|
279
|
+
/// @return {String} - an aria-controls selector
|
|
280
|
+
@function controls ($id, $op: '=') {
|
|
281
|
+
@if (type-of($id) != 'string') {
|
|
282
|
+
@error 'The controls function requires a string value for param 1.';
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
@if (type-of($op) != 'string') {
|
|
286
|
+
@error 'The controls function requires a string value for param 2.';
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@if not($op == '=' or $op == '~=' or $op == '|=' or $op == '^=' or $op == '$=' or $op == '*=') {
|
|
290
|
+
@error 'The controls function requires a valid attribute comparison operator for param 2.';
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@return '[aria-controls#{$op}#{prefix($id)}]';
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/// Creates an aria-expanded selector
|
|
297
|
+
/// @group Functions
|
|
298
|
+
///
|
|
299
|
+
/// @example scss - expanded function
|
|
300
|
+
/// expanded(true) // -> [aria-expanded=true]
|
|
301
|
+
///
|
|
302
|
+
/// @param {Bool} $bool - the value of the selector
|
|
303
|
+
/// @return {String} - an aria-expanded selector
|
|
304
|
+
@function expanded ($bool) {
|
|
305
|
+
@if (type-of($bool) == 'string') {
|
|
306
|
+
$bool: string.to-lower-case($bool);
|
|
307
|
+
|
|
308
|
+
@if not($bool == 'true' or $bool == 'false') {
|
|
309
|
+
@error 'The expanded function requires a boolean value.';
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@else if (type-of($bool) != 'bool') {
|
|
314
|
+
@error 'The expanded function requires a boolean value.';
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@return '[aria-expanded=#{$bool}]';
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/// Creates an aria-hidden selector
|
|
321
|
+
/// @group Functions
|
|
322
|
+
///
|
|
323
|
+
/// @example scss - hidden function
|
|
324
|
+
/// hidden(true) // -> [aria-hidden=true]
|
|
325
|
+
///
|
|
326
|
+
/// @param {Bool} $bool - the value of the selector
|
|
327
|
+
/// @return {String} - an aria-hidden selector
|
|
328
|
+
@function hidden ($bool) {
|
|
329
|
+
@if (type-of($bool) == 'string') {
|
|
330
|
+
$bool: string.to-lower-case($bool);
|
|
331
|
+
|
|
332
|
+
@if not($bool == 'true' or $bool == 'false') {
|
|
333
|
+
@error 'The hidden function requires a boolean value. Received: #{$bool}';
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
@else if (type-of($bool) !='bool') {
|
|
338
|
+
@error 'The hidden function requires a boolean value. Received: #{$bool}';
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
@return '[aria-hidden=#{$bool}]';
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/// Converts a number to ms
|
|
345
|
+
/// @group Functions
|
|
346
|
+
///
|
|
347
|
+
/// @example scss - ms function
|
|
348
|
+
/// ms(100) // -> 100ms
|
|
349
|
+
///
|
|
350
|
+
/// @param {Number} $val - the number of ms to return
|
|
351
|
+
/// @return {Number} the number as ms
|
|
352
|
+
@function ms ($val) {
|
|
353
|
+
@if (type-of($val) != 'number') {
|
|
354
|
+
@error 'The ms function requires a number value.';
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
@return $val * 1ms;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/// Converts a number to px
|
|
361
|
+
/// @group Functions
|
|
362
|
+
///
|
|
363
|
+
/// @example scss - px function
|
|
364
|
+
/// px(100) // -> 100px
|
|
365
|
+
///
|
|
366
|
+
/// @param {Number} $val - the number of px to return
|
|
367
|
+
/// @return {Number} - the number as px
|
|
368
|
+
@function px ($val) {
|
|
369
|
+
@if (type-of($val) != 'number') {
|
|
370
|
+
@error 'The px function requires a number value.';
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@return $val * 1px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/// Removes the unit from the given value
|
|
377
|
+
/// @group Functions
|
|
378
|
+
///
|
|
379
|
+
/// @example scss - strip-unit function
|
|
380
|
+
/// strip-unit(100px) // -> 100
|
|
381
|
+
///
|
|
382
|
+
/// @param {Number} $val - the value to strip
|
|
383
|
+
/// @return {Number} - the number without units
|
|
384
|
+
@function strip-unit($val) {
|
|
385
|
+
@if (type-of($val) != 'number') {
|
|
386
|
+
@error 'The strip-unit function requires a number value.';
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@return math.div($val, $val * 0 + 1);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/// Returns the percentage of the given values
|
|
393
|
+
/// @group Functions
|
|
394
|
+
///
|
|
395
|
+
/// @example scss - percent function
|
|
396
|
+
/// percent(100, 200) // -> 50%
|
|
397
|
+
///
|
|
398
|
+
/// @param {Number} $dividend - the value that will be devided
|
|
399
|
+
/// @param {Number} $divisor - the value that will devided by
|
|
400
|
+
/// @return {Number} - the percentage of the given values
|
|
401
|
+
/// @throws {Error} - if the values are not numbers
|
|
402
|
+
/// @throws {Error} - if the divisor is 0
|
|
403
|
+
@function percent($dividend, $divisor, $padding: 0) {
|
|
404
|
+
@if (type-of($dividend) != 'number' or type-of($divisor) != 'number' or type-of($padding) != 'number') {
|
|
405
|
+
@error 'The percent function requires number parameters.';
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
@if ($divisor == 0) {
|
|
409
|
+
@error 'The percent function requires a non-zero value for param 2.';
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
@if (strip-unit($padding) != 0) {
|
|
413
|
+
@return #{calc((($dividend * 100%) - $padding) / $divisor)}#{'%'};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
@return math.div($dividend * 100%, $divisor);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/// Returns the requested delay value as ms
|
|
420
|
+
/// @group Functions
|
|
421
|
+
///
|
|
422
|
+
/// @example scss - delay function
|
|
423
|
+
/// delay(default) // -> 300ms
|
|
424
|
+
///
|
|
425
|
+
/// @param {Number} $key - the key of the delay to use
|
|
426
|
+
/// @return {Number} - the delay value as ms
|
|
427
|
+
@function delay($key) {
|
|
428
|
+
@if not(map-has-key($delay, $key)) {
|
|
429
|
+
@error 'The delay function requires one of the following values: #{map-keys($delay)}';
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
@return ms(map-get($delay, $key));
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/// Returns the requested breakpoint value as px
|
|
436
|
+
/// @group Functions
|
|
437
|
+
///
|
|
438
|
+
/// @example scss - break function
|
|
439
|
+
/// break(md) // -> 1024px
|
|
440
|
+
///
|
|
441
|
+
/// @param {Number} $key - the key of the breakpoint to use
|
|
442
|
+
/// @return {Number} - the breakpoint value as px
|
|
443
|
+
@function break($key) {
|
|
444
|
+
@if not(map-has-key($break, $key)) {
|
|
445
|
+
@error 'The break function requires one of the following values: #{map-keys($break)}';
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
@return px(map-get($break, $key));
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/// Creates a prefixed CSS var definition
|
|
452
|
+
/// @group Mixins
|
|
453
|
+
///
|
|
454
|
+
/// @example scss - css-var mixin
|
|
455
|
+
/// @include css-var(bg, black) // -> --sun-bg: black;
|
|
456
|
+
///
|
|
457
|
+
/// @param {String} $key - the key of the CSS var
|
|
458
|
+
/// @param {Any} $val - the value of the CSS var
|
|
459
|
+
/// @output a prefixed CSS var definition
|
|
460
|
+
@mixin css-var ($key, $val) {
|
|
461
|
+
@if (type-of($key) != 'string') {
|
|
462
|
+
@error 'The css-var mixin requires a string for the $key argument.';
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
@if (string.index($key, '--') != 1) {
|
|
466
|
+
$key: css-prefix($key);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
#{$key}: #{$val};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/// Creates a prefixed CSS var reference
|
|
473
|
+
/// @group Mixins
|
|
474
|
+
///
|
|
475
|
+
/// @example scss - css-var-ref mixin
|
|
476
|
+
/// @include css-var-ref(fill, bg) // -> --sun-fill: var(--sun-bg);
|
|
477
|
+
///
|
|
478
|
+
/// @param {String} $key1 - the key of the new CSS var to define
|
|
479
|
+
/// @param {String} $key2 - the key of the referenced CSS var
|
|
480
|
+
/// @output a prefixed CSS var reference
|
|
481
|
+
@mixin css-var-ref ($key1, $key2) {
|
|
482
|
+
@if (type-of($key1) != 'string' or type-of($key2) != 'string') {
|
|
483
|
+
@error 'The css-var-ref mixin requires string values for both parameters.';
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
@include css-var($key1, css-var($key2));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/// Wraps the provided content in a media query
|
|
490
|
+
/// @group Mixins
|
|
491
|
+
///
|
|
492
|
+
/// @example scss - break mixin
|
|
493
|
+
/// @include break(md) { // -> @media (min-width: 1024px) {
|
|
494
|
+
/// display: none; // display: none;
|
|
495
|
+
/// } // }
|
|
496
|
+
///
|
|
497
|
+
/// @param {String} $min - the key of the breakpoint to use with min-width
|
|
498
|
+
/// @param {String} $max - the key of the breakpoint to use with max-width
|
|
499
|
+
/// @output the provided content wrapped in a media query
|
|
500
|
+
@mixin break ($min, $max: null) {
|
|
501
|
+
@if not(map-has-key($break, $min) and (type-of($max) == 'null' or map-has-key($break, $max))) {
|
|
502
|
+
@error 'The break mixin requires one or two of the following values: #{map-keys($break)}';
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
@if (map-has-key($break, $max)) {
|
|
506
|
+
@media (min-width: break($min)) and (max-width: break($max)) {
|
|
507
|
+
@content;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
@else {
|
|
512
|
+
@media (min-width: break($min)) {
|
|
513
|
+
@content;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
@mixin break-max ($max, $min: null) {
|
|
519
|
+
@if not(map-has-key($break, $max) and (type-of($min) == 'null' or map-has-key($break, $min))) {
|
|
520
|
+
@error 'The break-max mixin requires one or two of the following values: #{map-keys($break)}';
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@if (map-has-key($break, $min)) {
|
|
524
|
+
@media (min-width: break($min)) and (max-width: break($max)) {
|
|
525
|
+
@content;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
@else {
|
|
530
|
+
@media (max-width: break($max)) {
|
|
531
|
+
@content;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/// Creates utility selectors for a given property at each breakpoint
|
|
537
|
+
/// @group Mixins
|
|
538
|
+
///
|
|
539
|
+
/// @example scss- break-util mixin
|
|
540
|
+
/// @include break-util(display, flex); // -> & {
|
|
541
|
+
/// // display: flex;
|
|
542
|
+
/// //
|
|
543
|
+
/// // &-xs {
|
|
544
|
+
/// // display: none;
|
|
545
|
+
/// // @include break(xs) {
|
|
546
|
+
/// // display: flex;
|
|
547
|
+
/// // }
|
|
548
|
+
/// // }
|
|
549
|
+
/// // &-to-xs {
|
|
550
|
+
/// // display: flex;
|
|
551
|
+
/// // @include break(xs) {
|
|
552
|
+
/// // display: none;
|
|
553
|
+
/// // }
|
|
554
|
+
/// // }
|
|
555
|
+
/// // ...
|
|
556
|
+
/// // &-xl {
|
|
557
|
+
/// // display: none;
|
|
558
|
+
/// // @include break(xl) {
|
|
559
|
+
/// // display: flex;
|
|
560
|
+
/// // }
|
|
561
|
+
/// // }
|
|
562
|
+
/// // &-to-xl {
|
|
563
|
+
/// // display: flex;
|
|
564
|
+
/// // @include break(xl) {
|
|
565
|
+
/// // display: none;
|
|
566
|
+
/// // }
|
|
567
|
+
/// // }
|
|
568
|
+
/// // }
|
|
569
|
+
///
|
|
570
|
+
/// @param {String} $prop - the property to toggle
|
|
571
|
+
/// @param {Any} $val - the active value of the property
|
|
572
|
+
/// @param {Any} $none - the inactive value of the property
|
|
573
|
+
/// @output utility selectors for the given property at each breakpoint
|
|
574
|
+
@mixin break-util ($prop, $val, $none: "none") {
|
|
575
|
+
@if (type-of($prop) !='string') {
|
|
576
|
+
@error 'The break-util mixin requires a string for the $prop argument.';
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
& {
|
|
580
|
+
#{$prop}: #{$val};
|
|
581
|
+
|
|
582
|
+
@each $key,
|
|
583
|
+
$width in $break {
|
|
584
|
+
&-#{$key} {
|
|
585
|
+
#{$prop}: #{$none};
|
|
586
|
+
|
|
587
|
+
@include break($key) {
|
|
588
|
+
#{$prop}: #{$val};
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
&-to-#{$key} {
|
|
593
|
+
#{$prop}: #{$val};
|
|
594
|
+
|
|
595
|
+
@include break($key) {
|
|
596
|
+
#{$prop}: #{$none};
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/// Creates utility selectors for a box model property
|
|
604
|
+
/// @group Mixins
|
|
605
|
+
///
|
|
606
|
+
/// @example scss - box-util mixin
|
|
607
|
+
/// @include box-util(margin, 1rem, 0); // -> & {
|
|
608
|
+
///
|
|
609
|
+
@mixin box-util ($prop, $val) {
|
|
610
|
+
@if (type-of($prop) != 'string') {
|
|
611
|
+
@error 'The box-util mixin requires a string for the $prop argument.';
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
&-auto {
|
|
615
|
+
#{$prop}-left: auto;
|
|
616
|
+
#{$prop}-right: auto;
|
|
617
|
+
|
|
618
|
+
&-v {
|
|
619
|
+
#{$prop}: $val auto;
|
|
620
|
+
|
|
621
|
+
@for $i from 0 through 6 {
|
|
622
|
+
&#{$i} {
|
|
623
|
+
#{$prop}: $val * $i auto;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
&-t {
|
|
629
|
+
#{$prop}-top: $val;
|
|
630
|
+
#{$prop}-left: auto;
|
|
631
|
+
#{$prop}-right: auto;
|
|
632
|
+
|
|
633
|
+
@for $i from 0 through 6 {
|
|
634
|
+
&#{$i} {
|
|
635
|
+
#{$prop}-top: $val * $i;
|
|
636
|
+
#{$prop}-left: auto;
|
|
637
|
+
#{$prop}-right: auto;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
&-b {
|
|
643
|
+
#{$prop}-bottom: $val;
|
|
644
|
+
#{$prop}-left: auto;
|
|
645
|
+
#{$prop}-right: auto;
|
|
646
|
+
|
|
647
|
+
@for $i from 0 through 6 {
|
|
648
|
+
&#{$i} {
|
|
649
|
+
#{$prop}-bottom: $val * $i;
|
|
650
|
+
#{$prop}-left: auto;
|
|
651
|
+
#{$prop}-right: auto;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
&-v {
|
|
658
|
+
#{$prop}-top: $val;
|
|
659
|
+
#{$prop}-bottom: $val;
|
|
660
|
+
|
|
661
|
+
@for $i from 0 through 6 {
|
|
662
|
+
&#{$i} {
|
|
663
|
+
#{$prop}-top: $val * $i;
|
|
664
|
+
#{$prop}-bottom: $val * $i;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
&-t {
|
|
670
|
+
#{$prop}-top: $val;
|
|
671
|
+
|
|
672
|
+
@for $i from 0 through 6 {
|
|
673
|
+
&#{$i} {
|
|
674
|
+
#{$prop}-top: $val * $i;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
&#{50} {
|
|
679
|
+
#{$prop}-top: 50vh;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
&-b {
|
|
684
|
+
#{$prop}-bottom: $val;
|
|
685
|
+
|
|
686
|
+
@for $i from 0 through 6 {
|
|
687
|
+
&#{$i} {
|
|
688
|
+
#{$prop}-bottom: $val * $i;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
&-h {
|
|
694
|
+
#{$prop}-left: $val;
|
|
695
|
+
#{$prop}-right: $val;
|
|
696
|
+
|
|
697
|
+
@for $i from 0 through 6 {
|
|
698
|
+
&#{$i} {
|
|
699
|
+
#{$prop}-left: $val * $i;
|
|
700
|
+
#{$prop}-right: $val * $i;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
&-l {
|
|
706
|
+
#{$prop}-left: $val;
|
|
707
|
+
|
|
708
|
+
@for $i from 0 through 6 {
|
|
709
|
+
&#{$i} {
|
|
710
|
+
#{$prop}-left: $val * $i;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
&-r {
|
|
716
|
+
#{$prop}-right: $val;
|
|
717
|
+
|
|
718
|
+
@for $i from 0 through 6 {
|
|
719
|
+
&#{$i} {
|
|
720
|
+
#{$prop}-right: $val * $i;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
/// Generates a property with a fluid value between specified screen sizes
|
|
728
|
+
/// @group Mixins
|
|
729
|
+
///
|
|
730
|
+
/// @example scss - fluid mixin
|
|
731
|
+
/// @include fluid(font-size, 480px, 1024px, 18px, 16px); // -> & {
|
|
732
|
+
/// // font-size: 16px;
|
|
733
|
+
/// // @media (min-width: 480px) {
|
|
734
|
+
/// // font-size: calc(16px + 2 * ((100vw - 480px) / 544));
|
|
735
|
+
/// // }
|
|
736
|
+
/// // @media (min-width: 1024px) {
|
|
737
|
+
/// // font-size: 18px;
|
|
738
|
+
/// // }
|
|
739
|
+
/// // }
|
|
740
|
+
///
|
|
741
|
+
/// @param {String} $prop - the property whose value will be fluid
|
|
742
|
+
/// @param {String} $min-vw - the minimum screen width of the fluid property
|
|
743
|
+
/// @param {String} $max-vw - the maximum screen width of the fluid property
|
|
744
|
+
/// @param {String} $min-size - the minimum value of the fluid property
|
|
745
|
+
/// @param {String} $max-size - the maximum value of the fluid property
|
|
746
|
+
/// @output the definitions for the property at different screen sizes
|
|
747
|
+
@mixin fluid ($prop, $min-vw, $max-vw, $min-size, $max-size) {
|
|
748
|
+
$u1: unit($min-vw);
|
|
749
|
+
$u2: unit($max-vw);
|
|
750
|
+
$u3: unit($min-size);
|
|
751
|
+
$u4: unit($max-size);
|
|
752
|
+
|
|
753
|
+
@if (type-of($prop) !='string') {
|
|
754
|
+
@error 'The fluid mixin requires a string for the $prop argument.';
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
@if not(type-of($u1) == 'string' and type-of($u2) == 'string' and type-of($u3) == 'string' and type-of($u4) == 'string') {
|
|
758
|
+
@error 'The fluid mixin requires numbers with units for the width and size arguments.';
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
@if not($u1 == $u2 and $u1 == $u3 and $u1 == $u4) {
|
|
762
|
+
@error 'The fluid mixin requires width and size arguments with the same units.';
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// See if you can get rid of this wrapping & selector
|
|
766
|
+
& {
|
|
767
|
+
#{$prop}: $min-size;
|
|
768
|
+
|
|
769
|
+
@media (min-width: $min-vw) {
|
|
770
|
+
#{$prop}: calc(#{$min-size} + #{strip-unit($max-size - $min-size)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)}));
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
@media (min-width: $max-vw) {
|
|
774
|
+
#{$prop}: $max-size;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/// Generates css varibles for lighter, darker, or both variations
|
|
780
|
+
/// @group Mixins
|
|
781
|
+
///
|
|
782
|
+
/// @param {String} $name - the name of the color
|
|
783
|
+
/// @param {Color} $color - the color to generate variations for
|
|
784
|
+
/// @param {String} $type - the type of variation to generate
|
|
785
|
+
/// @param {Number} $number - the number of variations to generate
|
|
786
|
+
/// @param {String} $amount - the amount to vary the color by
|
|
787
|
+
/// @param {Boolean} $alpha - whether to generate alpha variations
|
|
788
|
+
/// @output css variables for different shades of the source color
|
|
789
|
+
@mixin shades ($name, $color, $type: both, $number: 7, $amount: 10%, $alpha: false) {
|
|
790
|
+
@if (type-of($name) != 'string') {
|
|
791
|
+
@error 'The shades mixin requires a string for the $name argument.';
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
@if (type-of($color) != 'color') {
|
|
795
|
+
@error 'The shades mixin requires a color for the $color argument.';
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
@if not($type == lighten or $type == darken or $type == both) {
|
|
799
|
+
@error 'The shades mixin requires a string of "lighten", "darken", or "both" for the $type argument.';
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
@if (type-of($number) != 'number') {
|
|
803
|
+
@error 'The shades mixin requires a number for the $number argument.';
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
@if (type-of($alpha) == 'string') {
|
|
807
|
+
$bool: string.to-lower-case($bool);
|
|
808
|
+
|
|
809
|
+
@if not($bool == 'true' or $bool == 'false') {
|
|
810
|
+
@error 'The shades mixin requires a boolean value for the $alpha argument. Received: #{$bool}';
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
@else if (type-of($alpha) != 'bool') {
|
|
815
|
+
@error 'The shades mixin requires a boolean value for the $alpha argument. Received: #{$bool}';
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
@include css-var(#{$name}, $color);
|
|
819
|
+
|
|
820
|
+
@if ($alpha) {
|
|
821
|
+
@if ($type == lighten) {
|
|
822
|
+
@for $i from 0 through $number - 1 {
|
|
823
|
+
@include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
@else if ($type == darken) {
|
|
828
|
+
@for $i from 0 through $number - 1 {
|
|
829
|
+
@include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: $i * math.div($amount, 100%)));
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
@else if ($type == both) {
|
|
834
|
+
$num-light: floor(math.div($number, 2));
|
|
835
|
+
|
|
836
|
+
@for $i from 0 through $num-light - 1 {
|
|
837
|
+
@include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
@include css-var(#{$name}-#{$num-light}, $color);
|
|
841
|
+
|
|
842
|
+
@for $i from $num-light + 1 through $number - 1 {
|
|
843
|
+
@include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: ($num-light - $i) * math.div($amount, 100%)));
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
@else {
|
|
849
|
+
@if ($type == lighten) {
|
|
850
|
+
@for $i from 0 through $number - 1 {
|
|
851
|
+
@include css-var(#{$name}-#{$i}, lighten($color, $i * $amount));
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
@else if ($type == darken) {
|
|
856
|
+
@for $i from 0 through $number - 1 {
|
|
857
|
+
@include css-var(#{$name}-#{$i}, darken($color, $i * $amount));
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
@else if ($type == both) {
|
|
862
|
+
$num-light: floor(math.div($number, 2));
|
|
863
|
+
|
|
864
|
+
@for $i from 0 through $num-light - 1 {
|
|
865
|
+
@include css-var(#{$name}-#{$i}, lighten($color, ($num-light - $i) * $amount));
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
@include css-var(#{$name}-#{$num-light}, $color);
|
|
869
|
+
|
|
870
|
+
@for $i from $num-light + 1 through $number - 1 {
|
|
871
|
+
@include css-var(#{$name}-#{$i}, darken($color, ($i - $num-light) * $amount));
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/// TODO: Document this
|
|
878
|
+
@mixin states ($states...) {
|
|
879
|
+
@each $state in $states {
|
|
880
|
+
@if (type-of($state) != 'string') {
|
|
881
|
+
@error 'The states mixin requires a string for each state argument.';
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
@if (index($states, 'hover') != null) {
|
|
886
|
+
&:hover {
|
|
887
|
+
@content;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
@if (index($states, 'focus') != null) {
|
|
892
|
+
&:focus-visible {
|
|
893
|
+
@content;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
@if (index($states, 'active') != null) {
|
|
898
|
+
|
|
899
|
+
&:active,
|
|
900
|
+
&#{class(active)} {
|
|
901
|
+
@content;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
@if (index($states, 'visited') != null) {
|
|
906
|
+
&:visited {
|
|
907
|
+
@content;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
@if (index($states, 'disabled') != null) {
|
|
912
|
+
&:disabled {
|
|
913
|
+
@content;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
@if (index($states, 'expanded') != null) {
|
|
918
|
+
&#{expanded(true)} {
|
|
919
|
+
@content;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/// Generates flex utility classes
|
|
925
|
+
/// @group Mixins
|
|
926
|
+
///
|
|
927
|
+
///
|
|
928
|
+
@mixin flex-util () {
|
|
929
|
+
& {
|
|
930
|
+
display: flex;
|
|
931
|
+
align-items: center;
|
|
932
|
+
justify-content: flex-start;
|
|
933
|
+
flex-wrap: wrap;
|
|
934
|
+
|
|
935
|
+
&#{class(center)} {
|
|
936
|
+
justify-content: center;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
&#{class(end)} {
|
|
940
|
+
justify-content: flex-end;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
&#{class(between)} {
|
|
944
|
+
justify-content: space-between;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
&#{class(around)} {
|
|
948
|
+
justify-content: space-around;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
&#{class(even)} {
|
|
952
|
+
justify-content: space-evenly;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/// Selector for all headers
|
|
958
|
+
/// @group Mixins
|
|
959
|
+
///
|
|
960
|
+
///
|
|
961
|
+
@mixin headers () {
|
|
962
|
+
@for $i from 1 through 6 {
|
|
963
|
+
h#{$i},
|
|
964
|
+
#{class(h#{$i})
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
{
|
|
968
|
+
@content;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
/// Background clip text
|
|
975
|
+
/// @group Mixins
|
|
976
|
+
///
|
|
977
|
+
///
|
|
978
|
+
@mixin background-clip ($color) {
|
|
979
|
+
color: $color;
|
|
980
|
+
|
|
981
|
+
@supports (-webkit-background-clip: text) and (-webkit-text-fill-color: transparent) {
|
|
982
|
+
background: $color;
|
|
983
|
+
@content;
|
|
984
|
+
background-clip: text;
|
|
985
|
+
-webkit-background-clip: text;
|
|
986
|
+
-webkit-text-fill-color: transparent;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
//////////////////////////////
|
|
993
|
+
/// EXPERIMENTAL //
|
|
994
|
+
//////////////////////////////
|
|
995
|
+
/// Variables
|
|
996
|
+
$animations: (
|
|
997
|
+
()
|
|
998
|
+
);
|
|
999
|
+
$transitions: (
|
|
1000
|
+
()
|
|
1001
|
+
);
|
|
1002
|
+
|
|
1003
|
+
/// Mixins
|
|
1004
|
+
/// Register an animation
|
|
1005
|
+
@mixin animation($animation) {
|
|
1006
|
+
$animations: map-merge($animations, (&: map-merge(map.get($animations, &), $animation)));
|
|
1007
|
+
$this: map.get($animations, &);
|
|
1008
|
+
$animation: '';
|
|
1009
|
+
|
|
1010
|
+
& {
|
|
1011
|
+
@each $item in $this {
|
|
1012
|
+
@if (list.index($this, $item) != 1) {
|
|
1013
|
+
$animation: #{$animation},
|
|
1014
|
+
;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
$animation: #{$animation}#{$item};
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
animation: $animation;
|
|
1021
|
+
|
|
1022
|
+
@each $name,
|
|
1023
|
+
$items in $animations {
|
|
1024
|
+
&#{class($name)} {
|
|
1025
|
+
animation: $animation;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
/// Register a transition
|
|
1032
|
+
@mixin transition($transition) {
|
|
1033
|
+
$transitions: map-merge($transitions, ($name: $transition));
|
|
1034
|
+
}
|