@appartmint/css-mint 0.0.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 ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@appartmint/css-mint",
3
+ "author": "App Art Mint LLC",
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "description": "Styles by App Art Mint",
8
+ "keywords": [
9
+ "styles",
10
+ "css",
11
+ "sass",
12
+ "scss",
13
+ "app art mint",
14
+ "appartmint"
15
+ ],
16
+ "homepage": "https://github.com/App-Art-Mint/css-mint#readme",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/App-Art-Mint/css-mint.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/App-Art-Mint/css-mint/issues"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "files": [
28
+ "src/**/*.scss",
29
+ "dist/**/*.{css,map}"
30
+ ],
31
+ "exports": {
32
+ ".": "./src/index.scss",
33
+ "./*": "./src/*.scss",
34
+ "./*/": "./src/*/index.scss"
35
+ },
36
+ "scripts": {
37
+ "version": "npm i && git add -A",
38
+ "postversion": "git push && git push --tags && cross-replace gh release create \"v$npm_package_version\" --generate-notes",
39
+ "clean": "rimraf dist"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^24.10.0",
43
+ "cross-replace": "^0.2.0",
44
+ "glob": "^11.0.3",
45
+ "npm-run-all2": "^8.0.4",
46
+ "rimraf": "^6.1.0",
47
+ "sass": "^1.93.3",
48
+ "typescript": "^5.9.3"
49
+ }
50
+ }
@@ -0,0 +1 @@
1
+ @use './input';
@@ -0,0 +1 @@
1
+ @use './toggle';
File without changes
@@ -0,0 +1 @@
1
+ @use './form';
package/src/index.scss ADDED
@@ -0,0 +1,2 @@
1
+ @use './components';
2
+ @use './themes';
@@ -0,0 +1,19 @@
1
+ @use '../util' as *;
2
+
3
+ :root {
4
+ /// Colors
5
+ @include css-var(c-black, #000);
6
+ @include css-var(c-white, #fff);
7
+
8
+ /// Brand Colors
9
+ @include css-var(c-brand, #bada55);
10
+ @include css-var(c-accent, #483d8b);
11
+ @include css-var(c-success, #208a20);
12
+ @include css-var(c-danger, #ff4d4d);
13
+ @include css-var(c-warning, #ffaa22);
14
+ @include css-var(c-info, #bada55);
15
+
16
+ /// App Colors
17
+ @include css-var(c-fg, color.adjust(c-black, $lightness: 10%));
18
+ @include css-var(c-bg, color.adjust(c-white, $lightness: -10%));
19
+ }
@@ -0,0 +1,10 @@
1
+ @use '../util' as *;
2
+
3
+ :root {
4
+ /// Fonts
5
+ @include css-var(c-font-text, sans-serif);
6
+ @include css-var(c-font-title, serif);
7
+ @include css-var(c-font-backups, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji');
8
+ @include css-var(c-font-title-backups, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji');
9
+ @include css-var(c-font-h, 1.25);
10
+ }
@@ -0,0 +1,3 @@
1
+ @use './colors';
2
+ @use './fonts';
3
+ @use './structure';
@@ -0,0 +1,16 @@
1
+ @use '../util' as *;
2
+
3
+ :root {
4
+ /// Borders
5
+ @include css-var(br, 1rem);
6
+ @include css-var(bw, 0.125rem);
7
+
8
+ /// Spacing
9
+ @include css-var(gap, 0.25rem);
10
+ @include css-var-ref(p-min, gap);
11
+ @include css-var(p-max, calc(css-var(gap) * 8));
12
+ @include css-var(p-val, 1vw);
13
+ @include css-var(p-clamp, clamp(css-var(p-min), css-var(p-val), css-var(p-max)));
14
+ @include css-var(p-exit, clamp(calc(css-var(p-min) * -1), calc(css-var(p-val) * -1), calc(css-var(p-max) * -1)));
15
+ @include css-var(p-exit-width, clamp(calc(100% + css-var(p-min) * 2), calc(100% + css-var(p-val) * 2), calc(100% + css-var(p-max) * 2)));
16
+ }
package/src/util.scss ADDED
@@ -0,0 +1,883 @@
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:list';
9
+ @use 'sass:map';
10
+ @use 'sass:math';
11
+ @use 'sass:meta';
12
+ @use 'sass:string';
13
+
14
+ /// Library name
15
+ /// @group Variables
16
+ /// @type String
17
+ $lib: mint !default;
18
+
19
+ /// Dash - variable name separator
20
+ /// @group Variables
21
+ /// @type String
22
+ $dash: #{'-'};
23
+
24
+ /// Prefix added to selectors
25
+ /// @group Variables
26
+ /// @type String
27
+ $pre: #{$lib}#{$dash};
28
+
29
+ /// Dot - added to classes
30
+ /// @group Variables
31
+ /// @type String
32
+ $dot: #{'.'};
33
+
34
+ /// Hash - added to ids
35
+ /// @group Variables
36
+ /// @type String
37
+ $hash: #{'#'};
38
+
39
+ /// CSS-selector for disabled elements
40
+ /// @group Variables
41
+ /// @type String
42
+ $disabled: #{'[disabled]'};
43
+
44
+ /// CSS-selector for elements with an aria-controls attribute
45
+ /// @group Variables
46
+ /// @type String
47
+ $has-controls: #{'[aria-controls]'};
48
+
49
+ /// CSS-selector for elements with an aria-expanded attribute
50
+ /// @group Variables
51
+ /// @type String
52
+ $has-expanded: #{'[aria-expanded]'};
53
+
54
+ /// CSS-selector for elements with an aria-hidden attribute
55
+ /// @group Variables
56
+ /// @type String
57
+ $has-hidden: #{'[aria-hidden]'};
58
+
59
+ /// CSS-selector for elements with an href attribute
60
+ /// @group Variables
61
+ /// @type String
62
+ $has-link: #{'[href]'};
63
+
64
+ /// CSS-selector for elements with a routerLink attribute
65
+ /// @group Variables
66
+ /// @type String
67
+ $has-router-link: #{'[routerLink]'};
68
+
69
+ /// CSS-selector for elements with an id attribute
70
+ /// @group Variables
71
+ /// @type String
72
+ $has-id: #{'[id]'};
73
+
74
+ /// CSS-selector for elements that aren't tabbable (i.e. tabindex is negative)
75
+ /// @group Variables
76
+ /// @type String
77
+ $not-tabbable: #{'[tabindex^="-"]'};
78
+
79
+ /// CSS-selector for elements that are tabbable (i.e. tabindex isn't negative)
80
+ /// @group Variables
81
+ /// @type String
82
+ $tabbable: #{'[tabindex]'}#{neg($not-tabbable)};
83
+
84
+ /// CSS-selector for submenu buttons
85
+ /// @group Variables
86
+ /// @type String
87
+ $sub-menu-buttons: #{'button'}#{$has-controls};
88
+
89
+ /// CSS-selector for submenus
90
+ /// @group Variables
91
+ /// @type String
92
+ $sub-menu: #{$sub-menu-buttons}#{' + ul'}#{$has-id};
93
+
94
+ /// Value added to all delay variables
95
+ /// @group Variables
96
+ /// @type Number
97
+ $delay-base: 0 !default;
98
+
99
+ /// Value added to all delay variables
100
+ /// @group Variables
101
+ /// @type Number
102
+ $delay-step: 100 !default;
103
+
104
+ /// Delay variables
105
+ /// @group Maps
106
+ /// @prop {Number} $delay.instant [0] - Instant: the quickest delay; close or equal to 0
107
+ /// @prop {Number} $delay.fast [100] - Fast: delays that happen quickly
108
+ /// @prop {Number} $delay.med-fast [200] - Med-Fast: delays that happen faster
109
+ /// @prop {Number} $delay.default [300] - Default: delays that are average
110
+ /// @prop {Number} $delay.med-slow [400] - Med-Slow: delays that happen slower
111
+ /// @prop {Number} $delay.slow [500] - Slow: delays that happen slowly
112
+ $delay: (
113
+ instant: $delay-base + $delay-step * 0,
114
+ fast: $delay-base + $delay-step * 1,
115
+ med-fast: $delay-base + $delay-step * 2,
116
+ default: $delay-base + $delay-step * 3,
117
+ med-slow: $delay-base + $delay-step * 4,
118
+ slow: $delay-base + $delay-step * 5
119
+ ) !default;
120
+
121
+ /// Breakpoint variables
122
+ /// @group Maps
123
+ /// @prop {Number} $break.xs [480] - Extra-Small: mobile devices
124
+ /// @prop {Number} $break.sm [768] - Small: small tablets, landscape mobiles
125
+ /// @prop {Number} $break.md [1024] - Medium: small desktops, large tablets
126
+ /// @prop {Number} $break.lg [1200] - Large: large desktops, landscape tablets
127
+ /// @prop {Number} $break.xl [1440] - Extra-Large: larger desktops
128
+ $break: (
129
+ xs: 480,
130
+ sm: 768,
131
+ md: 1024,
132
+ lg: 1200,
133
+ xl: 1440
134
+ ) !default;
135
+
136
+ /// True if Bootstrap5 is used in the project
137
+ /// @group Variables
138
+ /// @type Boolean
139
+ $bootstrap5: false !default;
140
+
141
+ @if ($bootstrap5) {
142
+ $break: (
143
+ sm: 576,
144
+ md: 768,
145
+ lg: 992,
146
+ xl: 1200,
147
+ xxl: 1400
148
+ ) !default;
149
+ }
150
+
151
+ /// Prefixes the provided string with the library name if it isn't already
152
+ /// @group Functions
153
+ ///
154
+ /// @example scss - prefix function
155
+ /// prefix(header) // -> sun-header
156
+ ///
157
+ /// @param {String} $base - the string to be prefixed
158
+ /// @return {String} - a prefixed string
159
+ @function prefix ($base) {
160
+ @if (meta.type-of($base) != 'string') {
161
+ @error 'The prefix function requires a string value.';
162
+ }
163
+
164
+ $base: string.to-lower-case($base);
165
+
166
+ @if (string.index($base, $pre) != 1) {
167
+ $base: #{$pre}#{$base};
168
+ }
169
+
170
+ @return $base;
171
+ }
172
+
173
+ /// Prefixes the provided string with two dashes and the library name if it isn't already
174
+ /// @group Functions
175
+ ///
176
+ /// @example scss - css-prefix function
177
+ /// css-prefix(background) // -> --sun-background
178
+ ///
179
+ /// @param {String} $base - the string to be prefixed
180
+ /// @return {String} - a prefixed string
181
+ @function css-prefix ($base) {
182
+ @if (meta.type-of($base) != 'string') {
183
+ @error 'The css-prefix function requires a string value.';
184
+ }
185
+
186
+ @while (string.index($base, $dash) == 1) {
187
+ $base: string.slice($base, 2);
188
+ }
189
+
190
+ @return #{$dash}#{$dash}#{prefix($base)};
191
+ }
192
+
193
+ /// Creates a CSS-var call for the prefixed `$base`
194
+ /// @group Functions
195
+ ///
196
+ /// @example scss - css-var function
197
+ /// css-var(background) // -> var(--sun-background)
198
+ ///
199
+ /// @param {String} $base - the CSS-var to create a call for
200
+ /// @return {String} - a CSS-var call
201
+ @function css-var ($base) {
202
+ @if (meta.type-of($base) != 'string') {
203
+ @error 'The css-var function requires a string value.';
204
+ }
205
+
206
+ @if (string.index($base, '--') != 1) {
207
+ $base: css-prefix($base);
208
+ }
209
+
210
+ @return var(#{$base});
211
+ }
212
+
213
+ /// Creates a class selector with the library prefix
214
+ /// @group Functions
215
+ ///
216
+ /// @example scss - class function
217
+ /// class(open) // -> .sun-open
218
+ ///
219
+ /// @param {String} $base - the name of the class
220
+ /// @return {String} - a class selector
221
+ @function class($base) {
222
+ @if (meta.type-of($base) != 'string') {
223
+ @error 'The class function requires a string value.';
224
+ }
225
+
226
+ @return #{$dot}#{prefix($base)};
227
+ }
228
+
229
+ /// Creates an id selector with the library prefix
230
+ /// @group Functions
231
+ ///
232
+ /// @example scss - id function
233
+ /// id(header) // -> #sun-header
234
+ ///
235
+ /// @param {String} $base - the name of the id
236
+ /// @param {String} $op - the comparison operator
237
+ /// @return {String} - an id selector
238
+ @function id ($base, $op: '=') {
239
+ @if (meta.type-of($base) != 'string') {
240
+ @error 'The id function requires a string value.';
241
+ }
242
+
243
+ @if (meta.type-of($op) != 'string') {
244
+ @error 'The controls function requires a string value for param 2.';
245
+ }
246
+
247
+ @if not($op == '=' or $op == '~=' or $op == '|=' or $op == '^=' or $op == '$=' or $op == '*=') {
248
+ @error 'The controls function requires a valid attribute comparison operator for param 2.';
249
+ }
250
+
251
+ @if ($op == '=') {
252
+ @return #{$hash}#{prefix($base)};
253
+ }
254
+
255
+ @return '[id#{$op}#{prefix($base)}]';
256
+ }
257
+
258
+ /// Creates an aria-controls selector with the library prefix
259
+ /// @group Functions
260
+ ///
261
+ /// @example scss - controls function
262
+ /// controls(header) // -> [aria-controls=sun-header]
263
+ ///
264
+ /// @param {String} $id - the id of the controlled element
265
+ /// @param {String} $op - the comparison operator
266
+ /// @return {String} - an aria-controls selector
267
+ @function controls ($id, $op: '=') {
268
+ @if (meta.type-of($id) != 'string') {
269
+ @error 'The controls function requires a string value for param 1.';
270
+ }
271
+
272
+ @if (meta.type-of($op) != 'string') {
273
+ @error 'The controls function requires a string value for param 2.';
274
+ }
275
+
276
+ @if not($op == '=' or $op == '~=' or $op == '|=' or $op == '^=' or $op == '$=' or $op == '*=') {
277
+ @error 'The controls function requires a valid attribute comparison operator for param 2.';
278
+ }
279
+
280
+ @return '[aria-controls#{$op}#{prefix($id)}]';
281
+ }
282
+
283
+ /// Creates an aria-expanded selector
284
+ /// @group Functions
285
+ ///
286
+ /// @example scss - expanded function
287
+ /// expanded(true) // -> [aria-expanded=true]
288
+ ///
289
+ /// @param {Bool} $bool - the value of the selector
290
+ /// @return {String} - an aria-expanded selector
291
+ @function expanded ($bool) {
292
+ @if (meta.type-of($bool) == 'string') {
293
+ $bool: string.to-lower-case($bool);
294
+
295
+ @if not($bool == 'true' or $bool == 'false') {
296
+ @error 'The expanded function requires a boolean value.';
297
+ }
298
+ }
299
+
300
+ @else if (meta.type-of($bool) != 'bool') {
301
+ @error 'The expanded function requires a boolean value.';
302
+ }
303
+
304
+ @return '[aria-expanded=#{$bool}]';
305
+ }
306
+
307
+ /// Creates an aria-hidden selector
308
+ /// @group Functions
309
+ ///
310
+ /// @example scss - hidden function
311
+ /// hidden(true) // -> [aria-hidden=true]
312
+ ///
313
+ /// @param {Bool} $bool - the value of the selector
314
+ /// @return {String} - an aria-hidden selector
315
+ @function hidden ($bool) {
316
+ @if (meta.type-of($bool) == 'string') {
317
+ $bool: string.to-lower-case($bool);
318
+
319
+ @if not($bool == 'true' or $bool == 'false') {
320
+ @error 'The hidden function requires a boolean value. Received: #{$bool}';
321
+ }
322
+ }
323
+
324
+ @else if (meta.type-of($bool) !='bool') {
325
+ @error 'The hidden function requires a boolean value. Received: #{$bool}';
326
+ }
327
+
328
+ @return '[aria-hidden=#{$bool}]';
329
+ }
330
+
331
+ /// Converts a number to ms
332
+ /// @group Functions
333
+ ///
334
+ /// @example scss - ms function
335
+ /// ms(100) // -> 100ms
336
+ ///
337
+ /// @param {Number} $val - the number of ms to return
338
+ /// @return {Number} the number as ms
339
+ @function ms ($val) {
340
+ @if (meta.type-of($val) != 'number') {
341
+ @error 'The ms function requires a number value.';
342
+ }
343
+
344
+ @return $val * 1ms;
345
+ }
346
+
347
+ /// Converts a number to px
348
+ /// @group Functions
349
+ ///
350
+ /// @example scss - px function
351
+ /// px(100) // -> 100px
352
+ ///
353
+ /// @param {Number} $val - the number of px to return
354
+ /// @return {Number} - the number as px
355
+ @function px ($val) {
356
+ @if (meta.type-of($val) != 'number') {
357
+ @error 'The px function requires a number value.';
358
+ }
359
+
360
+ @return $val * 1px;
361
+ }
362
+
363
+ /// Removes the unit from the given value
364
+ /// @group Functions
365
+ ///
366
+ /// @example scss - strip-unit function
367
+ /// strip-unit(100px) // -> 100
368
+ ///
369
+ /// @param {Number} $val - the value to strip
370
+ /// @return {Number} - the number without units
371
+ @function strip-unit($val) {
372
+ @if (meta.type-of($val) != 'number') {
373
+ @error 'The strip-unit function requires a number value.';
374
+ }
375
+
376
+ @return math.div($val, $val * 0 + 1);
377
+ }
378
+
379
+ /// Returns the percentage of the given values
380
+ /// @group Functions
381
+ ///
382
+ /// @example scss - percent function
383
+ /// percent(100, 200) // -> 50%
384
+ ///
385
+ /// @param {Number} $dividend - the value that will be devided
386
+ /// @param {Number} $divisor - the value that will devided by
387
+ /// @return {Number} - the percentage of the given values
388
+ /// @throws {Error} - if the values are not numbers
389
+ /// @throws {Error} - if the divisor is 0
390
+ @function percent($dividend, $divisor, $padding: 0) {
391
+ @if (meta.type-of($dividend) != 'number' or meta.type-of($divisor) != 'number' or meta.type-of($padding) != 'number') {
392
+ @error 'The percent function requires number parameters.';
393
+ }
394
+
395
+ @if ($divisor == 0) {
396
+ @error 'The percent function requires a non-zero value for param 2.';
397
+ }
398
+
399
+ @if (strip-unit($padding) != 0) {
400
+ @return #{calc((($dividend * 100%) - $padding) / $divisor)}#{'%'};
401
+ }
402
+
403
+ @return math.div($dividend * 100%, $divisor);
404
+ }
405
+
406
+ /// Returns the requested delay value as ms
407
+ /// @group Functions
408
+ ///
409
+ /// @example scss - delay function
410
+ /// delay(default) // -> 300ms
411
+ ///
412
+ /// @param {Number} $key - the key of the delay to use
413
+ /// @return {Number} - the delay value as ms
414
+ @function delay($key) {
415
+ @if not(map.has-key($delay, $key)) {
416
+ @error 'The delay function requires one of the following values: #{map-keys($delay)}';
417
+ }
418
+
419
+ @return ms(map.get($delay, $key));
420
+ }
421
+
422
+ /// Returns the requested breakpoint value as px
423
+ /// @group Functions
424
+ ///
425
+ /// @example scss - break function
426
+ /// break(md) // -> 1024px
427
+ ///
428
+ /// @param {Number} $key - the key of the breakpoint to use
429
+ /// @return {Number} - the breakpoint value as px
430
+ @function break($key) {
431
+ @if not(map.has-key($break, $key)) {
432
+ @error 'The break function requires one of the following values: #{map-keys($break)}';
433
+ }
434
+
435
+ @return px(map.get($break, $key));
436
+ }
437
+
438
+ /// Creates a prefixed CSS var definition
439
+ /// @group Mixins
440
+ ///
441
+ /// @example scss - css-var mixin
442
+ /// @include css-var(bg, black) // -> --sun-bg: black;
443
+ ///
444
+ /// @param {String} $key - the key of the CSS var
445
+ /// @param {Any} $val - the value of the CSS var
446
+ /// @output a prefixed CSS var definition
447
+ @mixin css-var ($key, $val) {
448
+ @if (meta.type-of($key) != 'string') {
449
+ @error 'The css-var mixin requires a string for the $key argument.';
450
+ }
451
+
452
+ @if (string.index($key, '--') != 1) {
453
+ $key: css-prefix($key);
454
+ }
455
+
456
+ #{$key}: #{$val};
457
+ }
458
+
459
+ /// Creates a prefixed CSS var reference
460
+ /// @group Mixins
461
+ ///
462
+ /// @example scss - css-var-ref mixin
463
+ /// @include css-var-ref(fill, bg) // -> --sun-fill: var(--sun-bg);
464
+ ///
465
+ /// @param {String} $key1 - the key of the new CSS var to define
466
+ /// @param {String} $key2 - the key of the referenced CSS var
467
+ /// @output a prefixed CSS var reference
468
+ @mixin css-var-ref ($key1, $key2) {
469
+ @if (meta.type-of($key1) != 'string' or meta.type-of($key2) != 'string') {
470
+ @error 'The css-var-ref mixin requires string values for both parameters.';
471
+ }
472
+
473
+ @include css-var($key1, css-var($key2));
474
+ }
475
+
476
+ /// Wraps the provided content in a media query
477
+ /// @group Mixins
478
+ ///
479
+ /// @example scss - break mixin
480
+ /// @include break(md) { // -> @media (min-width: 1024px) {
481
+ /// display: none; // display: none;
482
+ /// } // }
483
+ ///
484
+ /// @param {String} $min - the key of the breakpoint to use with min-width
485
+ /// @param {String} $max - the key of the breakpoint to use with max-width
486
+ /// @output the provided content wrapped in a media query
487
+ @mixin break ($min, $max: null) {
488
+ @if not(map.has-key($break, $min) and (meta.type-of($max) == 'null' or map.has-key($break, $max))) {
489
+ @error 'The break mixin requires one or two of the following values: #{map-keys($break)}';
490
+ }
491
+
492
+ @if (map.has-key($break, $max)) {
493
+ @media (min-width: break($min)) and (max-width: break($max)) {
494
+ @content;
495
+ }
496
+ }
497
+
498
+ @else {
499
+ @media (min-width: break($min)) {
500
+ @content;
501
+ }
502
+ }
503
+ }
504
+
505
+ @mixin break-max ($max, $min: null) {
506
+ @if not(map.has-key($break, $max) and (meta.type-of($min) == 'null' or map.has-key($break, $min))) {
507
+ @error 'The break-max mixin requires one or two of the following values: #{map-keys($break)}';
508
+ }
509
+
510
+ $break-max: break($max) - 1px;
511
+ @if (map.has-key($break, $min)) {
512
+ @media (min-width: break($min)) and (max-width: $break-max) {
513
+ @content;
514
+ }
515
+ }
516
+
517
+ @else {
518
+ @media (max-width: $break-max) {
519
+ @content;
520
+ }
521
+ }
522
+ }
523
+
524
+ /// Creates utility selectors for a given property at each breakpoint
525
+ /// @group Mixins
526
+ ///
527
+ /// @example scss- break-util mixin
528
+ /// @include break-util(display, flex); // -> & {
529
+ /// // display: flex;
530
+ /// //
531
+ /// // &-xs {
532
+ /// // display: none;
533
+ /// // @include break(xs) {
534
+ /// // display: flex;
535
+ /// // }
536
+ /// // }
537
+ /// // &-to-xs {
538
+ /// // display: flex;
539
+ /// // @include break(xs) {
540
+ /// // display: none;
541
+ /// // }
542
+ /// // }
543
+ /// // ...
544
+ /// // &-xl {
545
+ /// // display: none;
546
+ /// // @include break(xl) {
547
+ /// // display: flex;
548
+ /// // }
549
+ /// // }
550
+ /// // &-to-xl {
551
+ /// // display: flex;
552
+ /// // @include break(xl) {
553
+ /// // display: none;
554
+ /// // }
555
+ /// // }
556
+ /// // }
557
+ ///
558
+ /// @param {String} $prop - the property to toggle
559
+ /// @param {Any} $val - the active value of the property
560
+ /// @param {Any} $none - the inactive value of the property
561
+ /// @output utility selectors for the given property at each breakpoint
562
+ @mixin break-util ($prop, $val, $none: "none") {
563
+ @if (meta.type-of($prop) !='string') {
564
+ @error 'The break-util mixin requires a string for the $prop argument.';
565
+ }
566
+
567
+ & {
568
+ #{$prop}: #{$val};
569
+
570
+ @each $key,
571
+ $width in $break {
572
+ &-#{$key} {
573
+ #{$prop}: #{$none};
574
+
575
+ @include break($key) {
576
+ #{$prop}: #{$val};
577
+ }
578
+ }
579
+
580
+ &-to-#{$key} {
581
+ #{$prop}: #{$val};
582
+
583
+ @include break($key) {
584
+ #{$prop}: #{$none};
585
+ }
586
+ }
587
+ }
588
+ }
589
+ }
590
+
591
+ /// Creates utility selectors for a box model property
592
+ /// @group Mixins
593
+ @mixin box-util ($prop, $val) {
594
+ @if (meta.type-of($prop) != 'string') {
595
+ @error 'The box-util mixin requires a string for the $prop argument.';
596
+ }
597
+
598
+ &-auto {
599
+ #{$prop}-left: auto;
600
+ #{$prop}-right: auto;
601
+
602
+ &-v {
603
+ #{$prop}: $val auto;
604
+
605
+ @for $i from 0 through 6 {
606
+ &#{$i} {
607
+ #{$prop}: $val * $i auto;
608
+ }
609
+ }
610
+ }
611
+
612
+ &-t {
613
+ #{$prop}-top: $val;
614
+ #{$prop}-left: auto;
615
+ #{$prop}-right: auto;
616
+
617
+ @for $i from 0 through 6 {
618
+ &#{$i} {
619
+ #{$prop}-top: $val * $i;
620
+ #{$prop}-left: auto;
621
+ #{$prop}-right: auto;
622
+ }
623
+ }
624
+ }
625
+
626
+ &-b {
627
+ #{$prop}-bottom: $val;
628
+ #{$prop}-left: auto;
629
+ #{$prop}-right: auto;
630
+
631
+ @for $i from 0 through 6 {
632
+ &#{$i} {
633
+ #{$prop}-bottom: $val * $i;
634
+ #{$prop}-left: auto;
635
+ #{$prop}-right: auto;
636
+ }
637
+ }
638
+ }
639
+ }
640
+
641
+ &-v {
642
+ #{$prop}-top: $val;
643
+ #{$prop}-bottom: $val;
644
+
645
+ @for $i from 0 through 6 {
646
+ &#{$i} {
647
+ #{$prop}-top: $val * $i;
648
+ #{$prop}-bottom: $val * $i;
649
+ }
650
+ }
651
+ }
652
+
653
+ &-t {
654
+ #{$prop}-top: $val;
655
+
656
+ @for $i from 0 through 6 {
657
+ &#{$i} {
658
+ #{$prop}-top: $val * $i;
659
+ }
660
+ }
661
+
662
+ &#{50} {
663
+ #{$prop}-top: 50vh;
664
+ }
665
+ }
666
+
667
+ &-b {
668
+ #{$prop}-bottom: $val;
669
+
670
+ @for $i from 0 through 6 {
671
+ &#{$i} {
672
+ #{$prop}-bottom: $val * $i;
673
+ }
674
+ }
675
+ }
676
+
677
+ &-h {
678
+ #{$prop}-left: $val;
679
+ #{$prop}-right: $val;
680
+
681
+ @for $i from 0 through 6 {
682
+ &#{$i} {
683
+ #{$prop}-left: $val * $i;
684
+ #{$prop}-right: $val * $i;
685
+ }
686
+ }
687
+ }
688
+
689
+ &-l {
690
+ #{$prop}-left: $val;
691
+
692
+ @for $i from 0 through 6 {
693
+ &#{$i} {
694
+ #{$prop}-left: $val * $i;
695
+ }
696
+ }
697
+ }
698
+
699
+ &-r {
700
+ #{$prop}-right: $val;
701
+
702
+ @for $i from 0 through 6 {
703
+ &#{$i} {
704
+ #{$prop}-right: $val * $i;
705
+ }
706
+ }
707
+ }
708
+ }
709
+
710
+ /// Generates css varibles for lighter, darker, or both variations
711
+ /// @group Mixins
712
+ ///
713
+ /// @param {String} $name - the name of the color
714
+ /// @param {Color} $color - the color to generate variations for
715
+ /// @param {String} $type - the type of variation to generate
716
+ /// @param {Number} $number - the number of variations to geerate
717
+ /// @param {String} $amount - the amount to vary the color by
718
+ /// @param {Boolean} $alpha - whether to generate alpha variations
719
+ /// @output css variables for different shades of the source color
720
+ @mixin shades ($name, $color, $type: both, $number: 7, $amount: 10%, $alpha: false) {
721
+ @if (meta.type-of($name) != 'string') {
722
+ @error 'The shades mixin requires a string for the $name argument.';
723
+ }
724
+
725
+ @if (meta.type-of($color) != 'color') {
726
+ @error 'The shades mixin requires a color for the $colnor argument.';
727
+ }
728
+
729
+ @if not($type == lighten or $type == darken or $type == both) {
730
+ @error 'The shades mixin requires a string of "lighten", "darken", or "both" for the $type argument.';
731
+ }
732
+
733
+ @if (meta.type-of($number) != 'number') {
734
+ @error 'The shades mixin requires a number for the $number argument.';
735
+ }
736
+
737
+ @if (meta.type-of($alpha) == 'string') {
738
+ $bool: string.to-lower-case($bool);
739
+
740
+ @if not($bool == 'true' or $bool == 'false') {
741
+ @error 'The shades mixin requires a boolean value for the $alpha argument. Received: #{$bool}';
742
+ }
743
+ }
744
+
745
+ @else if (meta.type-of($alpha) != 'bool') {
746
+ @error 'The shades mixin requires a boolean value for the $alpha argument. Received: #{$bool}';
747
+ }
748
+
749
+ @include css-var(#{$name}, $color);
750
+
751
+ @if ($alpha) {
752
+ @if ($type == lighten) {
753
+ @for $i from 0 through $number - 1 {
754
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
755
+ }
756
+ }
757
+
758
+ @else if ($type == darken) {
759
+ @for $i from 0 through $number - 1 {
760
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: $i * math.div($amount, 100%)));
761
+ }
762
+ }
763
+
764
+ @else if ($type == both) {
765
+ $num-light: floor(math.div($number, 2));
766
+
767
+ @for $i from 0 through $num-light - 1 {
768
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: -$i * math.div($amount, 100%)));
769
+ }
770
+
771
+ @include css-var(#{$name}-#{$num-light}, $color);
772
+
773
+ @for $i from $num-light + 1 through $number - 1 {
774
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $alpha: ($num-light - $i) * math.div($amount, 100%)));
775
+ }
776
+ }
777
+ }
778
+
779
+ @else {
780
+ @if ($type == lighten) {
781
+ @for $i from 0 through $number - 1 {
782
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $lightness: $i * $amount));
783
+ }
784
+ }
785
+
786
+ @else if ($type == darken) {
787
+ @for $i from 0 through $number - 1 {
788
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $lightness: $i * -$amount));
789
+ }
790
+ }
791
+
792
+ @else if ($type == both) {
793
+ $num-light: math.floor(math.div($number, 2));
794
+
795
+ @for $i from 0 through $num-light - 1 {
796
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $lightness: ($num-light - $i) * $amount));
797
+ }
798
+
799
+ @include css-var(#{$name}-#{$num-light}, $color);
800
+
801
+ @for $i from $num-light + 1 through $number - 1 {
802
+ @include css-var(#{$name}-#{$i}, color.adjust($color, $lightness: ($i - $num-light) * -$amount));
803
+ }
804
+ }
805
+ }
806
+ }
807
+
808
+ /// TODO: Document this
809
+ @mixin states ($states...) {
810
+ @each $state in $states {
811
+ @if (meta.type-of($state) != 'string') {
812
+ @error 'The states mixin requires a string for each state argument.';
813
+ }
814
+ }
815
+
816
+ @if (list.index($states, 'hover') != null) {
817
+ &:hover {
818
+ @content;
819
+ }
820
+ }
821
+
822
+ @if (list.index($states, 'focus') != null) {
823
+ &:focus-visible {
824
+ @content;
825
+ }
826
+ }
827
+
828
+ @if (list.index($states, 'active') != null) {
829
+
830
+ &:active {
831
+ @content;
832
+ }
833
+ }
834
+
835
+ @if (list.index($states, 'mint-active') != null) {
836
+ &#{class(active)} {
837
+ @content;
838
+ }
839
+ }
840
+
841
+ @if (list.index($states, 'visited') != null) {
842
+ &:visited {
843
+ @content;
844
+ }
845
+ }
846
+
847
+ @if (list.index($states, 'disabled') != null) {
848
+ &:disabled {
849
+ @content;
850
+ }
851
+ }
852
+
853
+ @if (list.index($states, 'expanded') != null) {
854
+ &#{expanded(true)} {
855
+ @content;
856
+ }
857
+ }
858
+ }
859
+
860
+ /// Selector for all headers
861
+ /// @group Mixins
862
+ @mixin headers () {
863
+ @for $i from 1 through 6 {
864
+ h#{$i},
865
+ #{class(h#{$i})} {
866
+ @content;
867
+ }
868
+ }
869
+ }
870
+
871
+ /// Background clip text
872
+ /// @group Mixins
873
+ @mixin background-clip ($color) {
874
+ color: $color;
875
+
876
+ @supports (-webkit-background-clip: text) and (-webkit-text-fill-color: transparent) {
877
+ background: $color;
878
+ @content;
879
+ background-clip: text;
880
+ -webkit-background-clip: text;
881
+ -webkit-text-fill-color: transparent;
882
+ }
883
+ }