@appartmint/mint 0.10.2 → 0.10.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.
@@ -1,6 +1,6 @@
1
1
  /// util.scss - Variables, Functions, and Mixins to import elsewhere
2
2
  /// @author App/Art Mint
3
- ///
3
+ ///
4
4
  /// @group Util
5
5
 
6
6
  /// Imports
@@ -107,13 +107,12 @@ $delay-step: 100 !default;
107
107
  /// @prop {Number} $delay.med-slow [400] - Med-Slow: delays that happen slower
108
108
  /// @prop {Number} $delay.slow [500] - Slow: delays that happen slowly
109
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;
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) !default;
117
116
 
118
117
  /// Breakpoint variables
119
118
  /// @group Maps
@@ -123,374 +122,387 @@ $delay: (
123
122
  /// @prop {Number} $break.lg [1200] - Large: large desktops, landscape tablets
124
123
  /// @prop {Number} $break.xl [1440] - Extra-Large: larger desktops
125
124
  $break: (
126
- xs: 480,
127
- sm: 768,
128
- md: 1024,
129
- lg: 1200,
130
- xl: 1440
131
- ) !default;
125
+ xs: 480,
126
+ sm: 768,
127
+ md: 1024,
128
+ lg: 1200,
129
+ xl: 1440) !default;
132
130
 
133
131
  /// True if Bootstrap5 is used in the project
134
132
  /// @group Variables
135
133
  /// @type Boolean
136
134
  $bootstrap5: false !default;
135
+
137
136
  @if ($bootstrap5) {
138
- $break: (
139
- sm: 576,
140
- md: 768,
141
- lg: 992,
142
- xl: 1200,
143
- xxl: 1400
144
- ) !default;
137
+ $break: (sm: 576,
138
+ md: 768,
139
+ lg: 992,
140
+ xl: 1200,
141
+ xxl: 1400) !default;
145
142
  }
146
143
 
147
144
  /// Prefixes the provided string with the library name if it isn't already
148
145
  /// @group Functions
149
- ///
146
+ ///
150
147
  /// @example scss - prefix function
151
148
  /// prefix(header) // -> sun-header
152
- ///
149
+ ///
153
150
  /// @param {String} $base - the string to be prefixed
154
151
  /// @return {String} - a prefixed string
155
152
  @function prefix ($base) {
156
- @if (type-of($base) != 'string') {
157
- @error 'The prefix function requires a string value.';
158
- }
153
+ @if (type-of($base) !='string') {
154
+ @error 'The prefix function requires a string value.';
155
+ }
159
156
 
160
- $base: string.to-lower-case($base);
157
+ $base: string.to-lower-case($base
158
+ );
161
159
 
162
- @if (string.index($base, $pre) != 1) {
163
- $base: $pre + $base;
164
- }
160
+ @if (string.index($base, $pre) !=1) {
161
+ $base: $pre +$base;
162
+ }
165
163
 
166
- @return $base;
164
+ @return $base;
167
165
  }
168
166
 
169
167
  /// Prefixes the provided string with two dashes and the library name if it isn't already
170
168
  /// @group Functions
171
- ///
169
+ ///
172
170
  /// @example scss - css-prefix function
173
171
  /// css-prefix(background) // -> --sun-background
174
- ///
172
+ ///
175
173
  /// @param {String} $base - the string to be prefixed
176
174
  /// @return {String} - a prefixed string
177
175
  @function css-prefix ($base) {
178
- @if (type-of($base) != 'string') {
179
- @error 'The css-prefix function requires a string value.';
180
- }
176
+ @if (type-of($base) !='string') {
177
+ @error 'The css-prefix function requires a string value.';
178
+ }
181
179
 
182
- @while (string.index($base, $dash) == 1) {
183
- $base: string.slice($base, 2);
184
- }
180
+ @while (string.index($base, $dash)==1) {
181
+ $base: string.slice($base, 2);
182
+ }
185
183
 
186
- @return $dash + $dash + prefix($base);
184
+ @return $dash +$dash +prefix($base);
187
185
  }
188
186
 
189
187
  /// Creates a CSS-var call for the prefixed `$base`
190
188
  /// @group Functions
191
- ///
189
+ ///
192
190
  /// @example scss - css-var function
193
191
  /// css-var(background) // -> var(--sun-background)
194
- ///
192
+ ///
195
193
  /// @param {String} $base - the CSS-var to create a call for
196
194
  /// @return {String} - a CSS-var call
197
195
  @function css-var ($base) {
198
- @if (type-of($base) != 'string') {
199
- @error 'The css-var function requires a string value.';
200
- }
196
+ @if (type-of($base) !='string') {
197
+ @error 'The css-var function requires a string value.';
198
+ }
201
199
 
202
- @return var(css-prefix($base));
200
+ @return var(css-prefix($base));
203
201
  }
204
202
 
205
203
  /// Negates a provided CSS-selector
206
204
  /// @group Functions
207
- ///
205
+ ///
208
206
  /// @example scss - neg function
209
207
  /// neg(.sun-open) // -> :not(.sun-open)
210
- ///
208
+ ///
211
209
  /// @param {String} $base - the CSS-selector to negate
212
210
  /// @return {String} - a negated CSS-selector
213
211
  @function neg ($base) {
214
- @if (type-of($base) != 'string') {
215
- @error 'The neg function requires a string value.';
216
- }
212
+ @if (type-of($base) !='string') {
213
+ @error 'The neg function requires a string value.';
214
+ }
217
215
 
218
- @return ':not(' + $base + ')';
216
+ @return ':not('+$base +')';
219
217
  }
220
218
 
221
219
  /// Creates a class selector with the library prefix
222
220
  /// @group Functions
223
- ///
221
+ ///
224
222
  /// @example scss - class function
225
223
  /// class(open) // -> .sun-open
226
- ///
224
+ ///
227
225
  /// @param {String} $base - the name of the class
228
226
  /// @return {String} - a class selector
229
227
  @function class($base) {
230
- @if (type-of($base) != 'string') {
231
- @error 'The class function requires a string value.';
232
- }
228
+ @if (type-of($base) !='string') {
229
+ @error 'The class function requires a string value.';
230
+ }
233
231
 
234
- @return $dot + prefix($base);
232
+ @return $dot +prefix($base);
235
233
  }
236
234
 
237
235
  /// Creates an id selector with the library prefix
238
236
  /// @group Functions
239
- ///
237
+ ///
240
238
  /// @example scss - id function
241
239
  /// id(header) // -> #sun-header
242
- ///
240
+ ///
243
241
  /// @param {String} $base - the name of the id
244
242
  /// @param {String} $op - the comparison operator
245
243
  /// @return {String} - an id selector
246
244
  @function id ($base, $op: '=') {
247
- @if (type-of($base) != 'string') {
248
- @error 'The id function requires a string value.';
249
- }
250
- @if (type-of($op) != 'string') {
251
- @error 'The controls function requires a string value for param 2.';
252
- }
253
- @if not($op == '=' or $op == '~=' or $op == '|=' or $op == '^=' or $op == '$=' or $op == '*=') {
254
- @error 'The controls function requires a valid attribute comparison operator for param 2.';
255
- }
256
-
257
- @if ($op == '=') {
258
- @return $hash + prefix($base);
259
- }
260
- @return '[id' + $op + prefix($base) + ']';
245
+ @if (type-of($base) !='string') {
246
+ @error 'The id function requires a string value.';
247
+ }
248
+
249
+ @if (type-of($op) !='string') {
250
+ @error 'The controls function requires a string value for param 2.';
251
+ }
252
+
253
+ @if not($op =='=' or $op =='~=' or $op =='|=' or $op =='^=' or $op =='$=' or $op =='*=') {
254
+ @error 'The controls function requires a valid attribute comparison operator for param 2.';
255
+ }
256
+
257
+ @if ($op =='=') {
258
+ @return $hash +prefix($base);
259
+ }
260
+
261
+ @return '[id'+$op +prefix($base)+']';
261
262
  }
262
263
 
263
264
  /// Creates an aria-controls selector with the library prefix
264
265
  /// @group Functions
265
- ///
266
+ ///
266
267
  /// @example scss - controls function
267
268
  /// controls(header) // -> [aria-controls=sun-header]
268
- ///
269
+ ///
269
270
  /// @param {String} $id - the id of the controlled element
270
271
  /// @param {String} $op - the comparison operator
271
272
  /// @return {String} - an aria-controls selector
272
273
  @function controls ($id, $op: '=') {
273
- @if (type-of($id) != 'string') {
274
- @error 'The controls function requires a string value for param 1.';
275
- }
276
- @if (type-of($op) != 'string') {
277
- @error 'The controls function requires a string value for param 2.';
278
- }
279
- @if not($op == '=' or $op == '~=' or $op == '|=' or $op == '^=' or $op == '$=' or $op == '*=') {
280
- @error 'The controls function requires a valid attribute comparison operator for param 2.';
281
- }
282
-
283
- @return '[aria-controls' + $op + prefix($id) + ']';
274
+ @if (type-of($id) !='string') {
275
+ @error 'The controls function requires a string value for param 1.';
276
+ }
277
+
278
+ @if (type-of($op) !='string') {
279
+ @error 'The controls function requires a string value for param 2.';
280
+ }
281
+
282
+ @if not($op =='=' or $op =='~=' or $op =='|=' or $op =='^=' or $op =='$=' or $op =='*=') {
283
+ @error 'The controls function requires a valid attribute comparison operator for param 2.';
284
+ }
285
+
286
+ @return '[aria-controls'+$op +prefix($id)+']';
284
287
  }
285
288
 
286
289
  /// Creates an aria-expanded selector
287
290
  /// @group Functions
288
- ///
291
+ ///
289
292
  /// @example scss - expanded function
290
293
  /// expanded(true) // -> [aria-expanded=true]
291
- ///
294
+ ///
292
295
  /// @param {Bool} $bool - the value of the selector
293
296
  /// @return {String} - an aria-expanded selector
294
297
  @function expanded ($bool) {
295
- @if (type-of($bool) == 'string') {
296
- $bool: string.to-lower-case($bool);
297
-
298
- @if not($bool == 'true' or $bool == 'false') {
299
- @error 'The expanded function requires a boolean value.';
300
- }
301
- } @else if (type-of($bool) != 'bool') {
302
- @error 'The expanded function requires a boolean value.';
303
- }
304
-
305
- @return '[aria-expanded=' + $bool + ']';
298
+ @if (type-of($bool)=='string') {
299
+ $bool: string.to-lower-case($bool);
300
+
301
+ @if not($bool =='true' or $bool =='false') {
302
+ @error 'The expanded function requires a boolean value.';
303
+ }
304
+ }
305
+
306
+ @else if (type-of($bool) !='bool') {
307
+ @error 'The expanded function requires a boolean value.';
308
+ }
309
+
310
+ @return '[aria-expanded='+$bool +']';
306
311
  }
307
312
 
308
313
  /// Creates an aria-hidden selector
309
314
  /// @group Functions
310
- ///
315
+ ///
311
316
  /// @example scss - hidden function
312
317
  /// hidden(true) // -> [aria-hidden=true]
313
- ///
318
+ ///
314
319
  /// @param {Bool} $bool - the value of the selector
315
320
  /// @return {String} - an aria-hidden selector
316
321
  @function hidden ($bool) {
317
- @if (type-of($bool) == 'string') {
318
- $bool: string.to-lower-case($bool);
319
-
320
- @if not($bool == 'true' or $bool == 'false') {
321
- @error 'The hidden function requires a boolean value. Received: ' + $bool;
322
- }
323
- } @else if (type-of($bool) != 'bool') {
324
- @error 'The hidden function requires a boolean value. Received: ' + $bool;
325
- }
326
-
327
- @return '[aria-hidden=' + $bool + ']';
322
+ @if (type-of($bool)=='string') {
323
+ $bool: string.to-lower-case($bool);
324
+
325
+ @if not($bool =='true' or $bool =='false') {
326
+ @error 'The hidden function requires a boolean value. Received: '+$bool;
327
+ }
328
+ }
329
+
330
+ @else if (type-of($bool) !='bool') {
331
+ @error 'The hidden function requires a boolean value. Received: '+$bool;
332
+ }
333
+
334
+ @return '[aria-hidden='+$bool +']';
328
335
  }
329
336
 
330
337
  /// Converts a number to ms
331
338
  /// @group Functions
332
- ///
339
+ ///
333
340
  /// @example scss - ms function
334
341
  /// ms(100) // -> 100ms
335
- ///
342
+ ///
336
343
  /// @param {Number} $val - the number of ms to return
337
344
  /// @return {Number} the number as ms
338
345
  @function ms ($val) {
339
- @if (type-of($val) != 'number') {
340
- @error 'The ms function requires a number value.';
341
- }
346
+ @if (type-of($val) !='number') {
347
+ @error 'The ms function requires a number value.';
348
+ }
342
349
 
343
- @return $val * 1ms;
350
+ @return $val * 1ms;
344
351
  }
345
352
 
346
353
  /// Converts a number to px
347
354
  /// @group Functions
348
- ///
355
+ ///
349
356
  /// @example scss - px function
350
357
  /// px(100) // -> 100px
351
- ///
358
+ ///
352
359
  /// @param {Number} $val - the number of px to return
353
360
  /// @return {Number} - the number as px
354
361
  @function px ($val) {
355
- @if (type-of($val) != 'number') {
356
- @error 'The px function requires a number value.';
357
- }
362
+ @if (type-of($val) !='number') {
363
+ @error 'The px function requires a number value.';
364
+ }
358
365
 
359
- @return $val * 1px;
366
+ @return $val * 1px;
360
367
  }
361
368
 
362
369
  /// Removes the unit from the given value
363
370
  /// @group Functions
364
- ///
371
+ ///
365
372
  /// @example scss - strip-unit function
366
373
  /// strip-unit(100px) // -> 100
367
- ///
374
+ ///
368
375
  /// @param {Number} $val - the value to strip
369
376
  /// @return {Number} - the number without units
370
377
  @function strip-unit($val) {
371
- @if (type-of($val) != 'number') {
372
- @error 'The strip-unit function requires a number value.';
373
- }
378
+ @if (type-of($val) !='number') {
379
+ @error 'The strip-unit function requires a number value.';
380
+ }
374
381
 
375
- @return math.div($val, $val * 0 + 1);
382
+ @return math.div($val, $val * 0 + 1);
376
383
  }
377
384
 
378
385
  /// Returns the percentage of the given values
379
386
  /// @group Functions
380
- ///
387
+ ///
381
388
  /// @example scss - percent function
382
389
  /// percent(100, 200) // -> 50%
383
- ///
390
+ ///
384
391
  /// @param {Number} $dividend - the value that will be devided
385
392
  /// @param {Number} $divisor - the value that will devided by
386
393
  /// @return {Number} - the percentage of the given values
387
394
  /// @throws {Error} - if the values are not numbers
388
395
  /// @throws {Error} - if the divisor is 0
389
396
  @function percent($dividend, $divisor, $padding: 0) {
390
- @if (type-of($dividend) != 'number' or type-of($divisor) != 'number' or type-of($padding) != 'number') {
391
- @error 'The percent function requires number parameters.';
392
- }
393
- @if ($divisor == 0) {
394
- @error 'The percent function requires a non-zero value for param 2.';
395
- }
396
- @if (strip-unit($padding) != 0) {
397
- @return calc((($dividend * 100%) - $padding) / $divisor) + '%';
398
- }
399
- @return math.div($dividend * 100%, $divisor);
397
+ @if (type-of($dividend) !='number' or type-of($divisor) !='number' or type-of($padding) !='number') {
398
+ @error 'The percent function requires number parameters.';
399
+ }
400
+
401
+ @if ($divisor ==0) {
402
+ @error 'The percent function requires a non-zero value for param 2.';
403
+ }
404
+
405
+ @if (strip-unit($padding) !=0) {
406
+ @return calc((($dividend * 100%) - $padding) / $divisor)+'%';
407
+ }
408
+
409
+ @return math.div($dividend * 100%, $divisor);
400
410
  }
401
411
 
402
412
  /// Returns the requested delay value as ms
403
413
  /// @group Functions
404
- ///
414
+ ///
405
415
  /// @example scss - delay function
406
416
  /// delay(default) // -> 300ms
407
- ///
417
+ ///
408
418
  /// @param {Number} $key - the key of the delay to use
409
419
  /// @return {Number} - the delay value as ms
410
420
  @function delay($key) {
411
- @if not(map-has-key($delay, $key)) {
412
- @error 'The delay function requires one of the following values: #{map-keys($delay)}';
413
- }
421
+ @if not(map-has-key($delay, $key)) {
422
+ @error 'The delay function requires one of the following values: #{map-keys($delay)}';
423
+ }
414
424
 
415
- @return ms(map-get($delay, $key));
425
+ @return ms(map-get($delay, $key));
416
426
  }
417
427
 
418
428
  /// Returns the requested breakpoint value as px
419
429
  /// @group Functions
420
- ///
430
+ ///
421
431
  /// @example scss - break function
422
432
  /// break(md) // -> 1024px
423
- ///
433
+ ///
424
434
  /// @param {Number} $key - the key of the breakpoint to use
425
435
  /// @return {Number} - the breakpoint value as px
426
436
  @function break($key) {
427
- @if not(map-has-key($break, $key)) {
428
- @error 'The break function requires one of the following values: #{map-keys($break)}';
429
- }
437
+ @if not(map-has-key($break, $key)) {
438
+ @error 'The break function requires one of the following values: #{map-keys($break)}';
439
+ }
430
440
 
431
- @return px(map-get($break, $key));
441
+ @return px(map-get($break, $key));
432
442
  }
433
443
 
434
444
  /// Creates a prefixed CSS var definition
435
445
  /// @group Mixins
436
- ///
446
+ ///
437
447
  /// @example scss - css-var mixin
438
448
  /// @include css-var(bg, black) // -> --sun-bg: black;
439
- ///
449
+ ///
440
450
  /// @param {String} $key - the key of the CSS var
441
451
  /// @param {Any} $val - the value of the CSS var
442
452
  /// @output a prefixed CSS var definition
443
453
  @mixin css-var ($key, $val) {
444
- #{css-prefix($key)}: #{$val};
454
+ #{css-prefix($key)}: #{$val};
445
455
  }
446
456
 
447
457
  /// Creates a prefixed CSS var reference
448
458
  /// @group Mixins
449
- ///
459
+ ///
450
460
  /// @example scss - css-var-ref mixin
451
461
  /// @include css-var-ref(fill, bg) // -> --sun-fill: var(--sun-bg);
452
- ///
462
+ ///
453
463
  /// @param {String} $key1 - the key of the new CSS var to define
454
464
  /// @param {String} $key2 - the key of the referenced CSS var
455
465
  /// @output a prefixed CSS var reference
456
466
  @mixin css-var-ref ($key1, $key2) {
457
- @include css-var($key1, css-var($key2));
467
+ @include css-var($key1, css-var($key2));
458
468
  }
459
469
 
460
470
  /// Wraps the provided content in a media query
461
471
  /// @group Mixins
462
- ///
472
+ ///
463
473
  /// @example scss - break mixin
464
474
  /// @include break(md) { // -> @media (min-width: 1024px) {
465
475
  /// display: none; // display: none;
466
476
  /// } // }
467
- ///
477
+ ///
468
478
  /// @param {String} $min - the key of the breakpoint to use with min-width
469
479
  /// @param {String} $max - the key of the breakpoint to use with max-width
470
480
  /// @output the provided content wrapped in a media query
471
481
  @mixin break ($min, $max: null) {
472
- @if not(map-has-key($break, $min) and (type-of($max) == 'null' or map-has-key($break, $max))) {
473
- @error 'The break mixin requires one or two of the following values: #{map-keys($break)}';
474
- }
475
-
476
- @if (map-has-key($break, $max)) {
477
- @media (min-width: break($min)) and (max-width: break($max)) {
478
- @content;
479
- }
480
- } @else {
481
- @media (min-width: break($min)) {
482
- @content;
483
- }
484
- }
482
+ @if not(map-has-key($break, $min) and (type-of($max)=='null' or map-has-key($break, $max))) {
483
+ @error 'The break mixin requires one or two of the following values: #{map-keys($break)}';
484
+ }
485
+
486
+ @if (map-has-key($break, $max)) {
487
+ @media (min-width: break($min)) and (max-width: break($max)) {
488
+ @content;
489
+ }
490
+ }
491
+
492
+ @else {
493
+ @media (min-width: break($min)) {
494
+ @content;
495
+ }
496
+ }
485
497
  }
486
498
 
487
499
  /// Creates utility selectors for a given property at each breakpoint
488
500
  /// @group Mixins
489
- ///
501
+ ///
490
502
  /// @example scss- break-util mixin
491
503
  /// @include break-util(display, flex); // -> & {
492
504
  /// // display: flex;
493
- /// //
505
+ /// //
494
506
  /// // &-xs {
495
507
  /// // display: none;
496
508
  /// // @include break(xs) {
@@ -523,36 +535,37 @@ $bootstrap5: false !default;
523
535
  /// @param {Any} $none - the inactive value of the property
524
536
  /// @output utility selectors for the given property at each breakpoint
525
537
  @mixin break-util ($prop, $val, $none: "none") {
526
- @if (type-of($prop) != 'string') {
527
- @error 'The break-util mixin requires a string for the $prop argument.';
528
- }
529
-
530
- & {
531
- #{$prop}: #{$val};
532
-
533
- @each $key, $width in $break {
534
- &-#{$key} {
535
- #{$prop}: #{$none};
536
-
537
- @include break($key) {
538
- #{$prop}: #{$val};
539
- }
540
- }
541
-
542
- &-to-#{$key} {
543
- #{$prop}: #{$val};
544
-
545
- @include break($key) {
546
- #{$prop}: #{$none};
547
- }
548
- }
549
- }
550
- }
538
+ @if (type-of($prop) !='string') {
539
+ @error 'The break-util mixin requires a string for the $prop argument.';
540
+ }
541
+
542
+ & {
543
+ #{$prop}: #{$val};
544
+
545
+ @each $key,
546
+ $width in $break {
547
+ &-#{$key} {
548
+ #{$prop}: #{$none};
549
+
550
+ @include break($key) {
551
+ #{$prop}: #{$val};
552
+ }
553
+ }
554
+
555
+ &-to-#{$key} {
556
+ #{$prop}: #{$val};
557
+
558
+ @include break($key) {
559
+ #{$prop}: #{$none};
560
+ }
561
+ }
562
+ }
563
+ }
551
564
  }
552
565
 
553
566
  /// Generates a property with a fluid value between specified screen sizes
554
567
  /// @group Mixins
555
- ///
568
+ ///
556
569
  /// @example scss - fluid mixin
557
570
  /// @include fluid(font-size, 480px, 1024px, 18px, 16px); // -> & {
558
571
  /// // font-size: 16px;
@@ -563,7 +576,7 @@ $bootstrap5: false !default;
563
576
  /// // font-size: 18px;
564
577
  /// // }
565
578
  /// // }
566
- ///
579
+ ///
567
580
  /// @param {String} $prop - the property whose value will be fluid
568
581
  /// @param {String} $min-vw - the minimum screen width of the fluid property
569
582
  /// @param {String} $max-vw - the maximum screen width of the fluid property
@@ -571,31 +584,35 @@ $bootstrap5: false !default;
571
584
  /// @param {String} $max-size - the maximum value of the fluid property
572
585
  /// @output the definitions for the property at different screen sizes
573
586
  @mixin fluid ($prop, $min-vw, $max-vw, $min-size, $max-size) {
574
- $u1: unit($min-vw);
575
- $u2: unit($max-vw);
576
- $u3: unit($min-size);
577
- $u4: unit($max-size);
578
-
579
- @if (type-of($prop) != 'string') {
580
- @error 'The fluid mixin requires a string for the $prop argument.';
581
- }
582
- @if not(type-of($u1) == 'string' and type-of($u2) == 'string' and type-of($u3) == 'string' and type-of($u4) == 'string') {
583
- @error 'The fluid mixin requires numbers for the width and size arguments.';
584
- }
585
- @if not($u1 == $u2 and $u1 == $u3 and $u1 == $u4) {
586
- @error 'The fluid mixin requires width and size arguments with the same units.';
587
- }
588
-
589
- // See if you can get rid of this wrapping & selector
590
- & {
591
- #{$prop}: $min-size;
592
- @media (min-width: $min-vw) {
593
- #{$prop}: calc(#{$min-size} + #{strip-unit($max-size - $min-size)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)}));
594
- }
595
- @media (min-width: $max-vw) {
596
- #{$prop}: $max-size;
597
- }
598
- }
587
+ $u1: unit($min-vw);
588
+ $u2: unit($max-vw);
589
+ $u3: unit($min-size);
590
+ $u4: unit($max-size);
591
+
592
+ @if (type-of($prop) !='string') {
593
+ @error 'The fluid mixin requires a string for the $prop argument.';
594
+ }
595
+
596
+ @if not(type-of($u1)=='string' and type-of($u2)=='string' and type-of($u3)=='string' and type-of($u4)=='string') {
597
+ @error 'The fluid mixin requires numbers for the width and size arguments.';
598
+ }
599
+
600
+ @if not($u1 ==$u2 and $u1 ==$u3 and $u1 ==$u4) {
601
+ @error 'The fluid mixin requires width and size arguments with the same units.';
602
+ }
603
+
604
+ // See if you can get rid of this wrapping & selector
605
+ & {
606
+ #{$prop}: $min-size;
607
+
608
+ @media (min-width: $min-vw) {
609
+ #{$prop}: calc(#{$min-size} + #{strip-unit($max-size - $min-size)} * ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)}));
610
+ }
611
+
612
+ @media (min-width: $max-vw) {
613
+ #{$prop}: $max-size;
614
+ }
615
+ }
599
616
  }
600
617
 
601
618
  /// Generates css varibles for lighter, darker, or both variations
@@ -609,150 +626,246 @@ $bootstrap5: false !default;
609
626
  /// @param {Boolean} $alpha - whether to generate alpha variations
610
627
  /// @output css variables for different shades of the source color
611
628
  @mixin shades ($name, $color, $type: both, $number: 7, $amount: 10%, $alpha: false) {
612
- @if (type-of($name) != 'string') {
613
- @error 'The shades mixin requires a string for the $name argument.';
614
- }
615
- @if (type-of($color) != 'color') {
616
- @error 'The shades mixin requires a color for the $color argument.';
617
- }
618
- @if not($type == lighten or $type == darken or $type == both) {
619
- @error 'The shades mixin requires a string of "lighten", "darken", or "both" for the $type argument.';
620
- }
621
- @if (type-of($number) != 'number') {
622
- @error 'The shades mixin requires a number for the $number argument.';
623
- }
624
- @if (type-of($alpha) == 'string') {
625
- $bool: string.to-lower-case($bool);
626
-
627
- @if not($bool == 'true' or $bool == 'false') {
628
- @error 'The shades mixin requires a boolean value for the $alpha argument. Received: ' + $bool;
629
- }
630
- } @else if (type-of($alpha) != 'bool') {
631
- @error 'The shades mixin requires a boolean value for the $alpha argument. Received: ' + $bool;
632
- }
633
-
634
- @include css-var(#{$name}, $color);
635
-
636
- @if ($alpha) {
637
- @if ($type == lighten) {
638
- @for $i from 0 through $number - 1 {
639
- @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
640
- }
641
- } @else if ($type == darken) {
642
- @for $i from 0 through $number - 1 {
643
- @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: $i * math.div($amount, 100%)));
644
- }
645
- } @else if ($type == both) {
646
- $num-light: floor(math.div($number, 2));
647
- @for $i from 0 through $num-light - 1 {
648
- @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
649
- }
650
- @include css-var(#{$name}-#{$num-light}, $color);
651
- @for $i from $num-light + 1 through $number - 1 {
652
- @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: ($num-light - $i) * math.div($amount, 100%)));
653
- }
654
- }
655
- } @else {
656
- @if ($type == lighten) {
657
- @for $i from 0 through $number - 1 {
658
- @include css-var(#{$name}-#{$i}, lighten($color, $i * $amount));
659
- }
660
- } @else if ($type == darken) {
661
- @for $i from 0 through $number - 1 {
662
- @include css-var(#{$name}-#{$i}, darken($color, $i * $amount));
663
- }
664
- } @else if ($type == both) {
665
- $num-light: floor(math.div($number, 2));
666
- @for $i from 0 through $num-light - 1 {
667
- @include css-var(#{$name}-#{$i}, lighten($color, ($num-light - $i) * $amount));
668
- }
669
- @include css-var(#{$name}-#{$num-light}, $color);
670
- @for $i from $num-light + 1 through $number - 1 {
671
- @include css-var(#{$name}-#{$i}, darken($color, ($i - $num-light) * $amount));
672
- }
673
- }
674
- }
629
+ @if (type-of($name) !='string') {
630
+ @error 'The shades mixin requires a string for the $name argument.';
631
+ }
632
+
633
+ @if (type-of($color) !='color') {
634
+ @error 'The shades mixin requires a color for the $color argument.';
635
+ }
636
+
637
+ @if not($type ==lighten or $type ==darken or $type ==both) {
638
+ @error 'The shades mixin requires a string of "lighten", "darken", or "both" for the $type argument.';
639
+ }
640
+
641
+ @if (type-of($number) !='number') {
642
+ @error 'The shades mixin requires a number for the $number argument.';
643
+ }
644
+
645
+ @if (type-of($alpha)=='string') {
646
+ $bool: string.to-lower-case($bool);
647
+
648
+ @if not($bool =='true' or $bool =='false') {
649
+ @error 'The shades mixin requires a boolean value for the $alpha argument. Received: '+$bool;
650
+ }
651
+ }
652
+
653
+ @else if (type-of($alpha) !='bool') {
654
+ @error 'The shades mixin requires a boolean value for the $alpha argument. Received: '+$bool;
655
+ }
656
+
657
+ @include css-var(#{$name}, $color);
658
+
659
+ @if ($alpha) {
660
+ @if ($type ==lighten) {
661
+ @for $i from 0 through $number - 1 {
662
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
663
+ }
664
+ }
665
+
666
+ @else if ($type ==darken) {
667
+ @for $i from 0 through $number - 1 {
668
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: $i * math.div($amount, 100%)));
669
+ }
670
+ }
671
+
672
+ @else if ($type ==both) {
673
+ $num-light: floor(math.div($number, 2));
674
+
675
+ @for $i from 0 through $num-light - 1 {
676
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
677
+ }
678
+
679
+ @include css-var(#{$name}-#{$num-light}, $color);
680
+
681
+ @for $i from $num-light +1 through $number - 1 {
682
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: ($num-light - $i) * math.div($amount, 100%)));
683
+ }
684
+ }
685
+ }
686
+
687
+ @else {
688
+ @if ($type ==lighten) {
689
+ @for $i from 0 through $number - 1 {
690
+ @include css-var(#{$name}-#{$i}, lighten($color, $i * $amount));
691
+ }
692
+ }
693
+
694
+ @else if ($type ==darken) {
695
+ @for $i from 0 through $number - 1 {
696
+ @include css-var(#{$name}-#{$i}, darken($color, $i * $amount));
697
+ }
698
+ }
699
+
700
+ @else if ($type ==both) {
701
+ $num-light: floor(math.div($number, 2));
702
+
703
+ @for $i from 0 through $num-light - 1 {
704
+ @include css-var(#{$name}-#{$i}, lighten($color, ($num-light - $i) * $amount));
705
+ }
706
+
707
+ @include css-var(#{$name}-#{$num-light}, $color);
708
+
709
+ @for $i from $num-light +1 through $number - 1 {
710
+ @include css-var(#{$name}-#{$i}, darken($color, ($i - $num-light) * $amount));
711
+ }
712
+ }
713
+ }
675
714
  }
676
715
 
677
716
  /// TODO: Document this
678
717
  @mixin states ($states...) {
679
- @each $state in $states {
680
- @if (type-of($state) != 'string') {
681
- @error 'The states mixin requires a string for each state argument.';
682
- }
683
- @if not($state == 'hover' or $state == 'focus' or $state == 'active' or $state == 'visited' or $state == 'disabled') {
684
- @error 'The states mixin requires a string of "hover", "focus", "active", "visited", or "disabled" for each state argument.';
685
- }
686
- }
687
-
688
- @if (index($states, 'hover') != null) {
689
- &:hover {
690
- @content;
691
- }
692
- }
693
- @if (index($states, 'focus') != null) {
694
- &:focus {
695
- @content;
696
- }
697
- }
698
- @if (index($states, 'active') != null) {
699
- &:active, &#{class(active)} {
700
- @content;
701
- }
702
- }
703
- @if (index($states, 'visited') != null) {
704
- &:visited {
705
- @content;
706
- }
707
- }
708
- @if (index($states, 'disabled') != null) {
709
- &:disabled {
710
- @content;
711
- }
712
- }
718
+ @each $state in $states {
719
+ @if (type-of($state) !='string') {
720
+ @error 'The states mixin requires a string for each state argument.';
721
+ }
722
+
723
+ @if not($state =='hover' or $state =='focus' or $state =='active' or $state =='visited' or $state =='disabled') {
724
+ @error 'The states mixin requires a string of "hover", "focus", "active", "visited", or "disabled" for each state argument.';
725
+ }
726
+ }
727
+
728
+ @if (index($states, 'hover') !=null) {
729
+ &:hover {
730
+ @content;
731
+ }
732
+ }
733
+
734
+ @if (index($states, 'focus') !=null) {
735
+ &:focus {
736
+ @content;
737
+ }
738
+ }
739
+
740
+ @if (index($states, 'active') !=null) {
741
+
742
+ &:active,
743
+ &#{class(active)} {
744
+ @content;
745
+ }
746
+ }
747
+
748
+ @if (index($states, 'visited') !=null) {
749
+ &:visited {
750
+ @content;
751
+ }
752
+ }
753
+
754
+ @if (index($states, 'disabled') !=null) {
755
+ &:disabled {
756
+ @content;
757
+ }
758
+ }
713
759
  }
714
760
 
715
761
  /// Generates flex utility classes
716
762
  /// @group Mixins
717
- ///
718
- ///
763
+ ///
764
+ ///
719
765
  @mixin flex-util () {
720
- & {
721
- display: flex;
722
- align-items: center;
723
- justify-content: flex-start;
724
- flex-wrap: wrap;
725
-
726
- &#{class(center)} {
727
- justify-content: center;
728
- }
729
-
730
- &#{class(end)} {
731
- justify-content: flex-end;
732
- }
733
-
734
- &#{class(between)} {
735
- justify-content: space-between;
736
- }
737
-
738
- &#{class(around)} {
739
- justify-content: space-around;
740
- }
741
-
742
- &#{class(even)} {
743
- justify-content: space-evenly;
744
- }
745
- }
766
+ & {
767
+ display: flex;
768
+ align-items: center;
769
+ justify-content: flex-start;
770
+ flex-wrap: wrap;
771
+
772
+ &#{class(center)} {
773
+ justify-content: center;
774
+ }
775
+
776
+ &#{class(end)} {
777
+ justify-content: flex-end;
778
+ }
779
+
780
+ &#{class(between)} {
781
+ justify-content: space-between;
782
+ }
783
+
784
+ &#{class(around)} {
785
+ justify-content: space-around;
786
+ }
787
+
788
+ &#{class(even)} {
789
+ justify-content: space-evenly;
790
+ }
791
+ }
746
792
  }
747
793
 
748
794
  /// Selector for all headers
749
795
  /// @group Mixins
750
- ///
751
- ///
796
+ ///
797
+ ///
752
798
  @mixin headers () {
753
- @for $i from 1 through 6 {
754
- h#{$i}, #{class(h#{$i})} {
755
- @content;
756
- }
757
- }
799
+ @for $i from 1 through 6 {
800
+ h#{$i},
801
+ #{class(h#{$i})
802
+ }
803
+
804
+ {
805
+ @content;
806
+ }
807
+ }
808
+ }
809
+
810
+
811
+ /// Background clip text
812
+ /// @group Mixins
813
+ ///
814
+ ///
815
+ @mixin background-clip ($color) {
816
+ color: $color;
817
+
818
+ @supports (-webkit-background-clip: text) and (-webkit-text-fill-color: transparent) {
819
+ background: $color;
820
+ @content;
821
+ background-clip: text;
822
+ -webkit-background-clip: text;
823
+ -webkit-text-fill-color: transparent;
824
+ }
825
+ }
826
+
827
+
828
+
829
+ //////////////////////////////
830
+ /// EXPERIMENTAL //
831
+ //////////////////////////////
832
+ /// Variables
833
+ $animations: (
834
+ ()
835
+ );
836
+ $transitions: (
837
+ ()
838
+ );
839
+
840
+ /// Mixins
841
+ /// Register an animation
842
+ @mixin animation($animation) {
843
+ $animations: map-merge($animations, (&: map-merge(map.get($animations, &), $animation)));
844
+ $this: map.get($animations, &);
845
+ $animation: '';
846
+
847
+ & {
848
+ @each $item in $this {
849
+ @if (list.index($this, $item) !=1) {
850
+ $animation: #{$animation},
851
+ ;
852
+ }
853
+
854
+ $animation: #{$animation}#{$item};
855
+ }
856
+
857
+ animation: $animation;
858
+
859
+ @each $name,
860
+ $items in $animations {
861
+ &#{class($name)} {
862
+ animation: $animation;
863
+ }
864
+ }
865
+ }
866
+ }
867
+
868
+ /// Register a transition
869
+ @mixin transition($transition) {
870
+ $transitions: map-merge($transitions, ($name: $transition));
758
871
  }