yummacss 1.2.0 → 2.0.0

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.
@@ -0,0 +1,43 @@
1
+ $yma-breakpoints: (
2
+ "sm": 640px,
3
+ "md": 768px,
4
+ "lg": 1024px,
5
+ "xl": 1280px,
6
+ "xxl": 1536px,
7
+ );
8
+
9
+ @mixin sm {
10
+ @media (min-width: map-get($yma-breakpoints, "sm")) {
11
+ @content;
12
+ }
13
+ }
14
+
15
+ @mixin md {
16
+ @media (min-width: map-get($yma-breakpoints, "md")) {
17
+ @content;
18
+ }
19
+ }
20
+
21
+ @mixin lg {
22
+ @media (min-width: map-get($yma-breakpoints, "lg")) {
23
+ @content;
24
+ }
25
+ }
26
+
27
+ @mixin xl {
28
+ @media (min-width: map-get($yma-breakpoints, "xl")) {
29
+ @content;
30
+ }
31
+ }
32
+
33
+ @mixin xxl {
34
+ @media (min-width: map-get($yma-breakpoints, "xxl")) {
35
+ @content;
36
+ }
37
+ }
38
+
39
+ @mixin breakpoint($bp) {
40
+ @media (min-width: $bp) {
41
+ @content;
42
+ }
43
+ }
@@ -0,0 +1,29 @@
1
+ @import "mixins";
2
+
3
+ @each $k, $v in $yma-colors {
4
+ @include color-variants("accent-color", "ac", $k, $v);
5
+ @include color-variants("background-color", "bg", $k, $v);
6
+ @include color-variants("border-bottom-color", "bc-b", $k, $v);
7
+ @include color-variants("border-color", "bc", $k, $v);
8
+ @include color-variants("border-left-color", "bc-l", $k, $v);
9
+ @include color-variants("border-right-color", "bc-r", $k, $v);
10
+ @include color-variants("border-top-color", "bc-t", $k, $v);
11
+ @include color-variants("caret-color", "cc", $k, $v);
12
+ @include color-variants("color", "tc", $k, $v);
13
+ @include color-variants("outline-color", "oc", $k, $v);
14
+ @include color-variants("text-decoration-color", "tdc", $k, $v);
15
+
16
+ @if (is-not-mono($v, $yma-colors)) {
17
+ @include shade-variants("accent-color", "ac", $k, $v, 10%);
18
+ @include shade-variants("background-color", "bg", $k, $v, 10%);
19
+ @include shade-variants("border-bottom-color", "bc-b", $k, $v, 10%);
20
+ @include shade-variants("border-color", "bc", $k, $v, 10%);
21
+ @include shade-variants("border-left-color", "bc-l", $k, $v, 10%);
22
+ @include shade-variants("border-right-color", "bc-r", $k, $v, 10%);
23
+ @include shade-variants("border-top-color", "bc-t", $k, $v, 10%);
24
+ @include shade-variants("caret-color", "cc", $k, $v, 10%);
25
+ @include shade-variants("color", "tc", $k, $v, 10%);
26
+ @include shade-variants("outline-color", "oc", $k, $v, 10%);
27
+ @include shade-variants("text-decoration-color", "tdc", $k, $v, 10%);
28
+ }
29
+ }
@@ -0,0 +1,4 @@
1
+ @function is-not-mono($v, $yma-colors) {
2
+ @return $v != map-get($yma-colors, "black") and $v !=
3
+ map-get($yma-colors, "white") and $v != map-get($yma-colors, "transparent");
4
+ }
@@ -0,0 +1,18 @@
1
+ @import "mixins";
2
+ @import "breakpoints";
3
+
4
+ .cnt {
5
+ width: 100%;
6
+
7
+ @each $bp, $bp-value in $yma-breakpoints {
8
+ @include breakpoint($bp-value) {
9
+ max-width: $bp-value;
10
+ }
11
+ }
12
+ }
13
+
14
+ .ins {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ }
@@ -0,0 +1,589 @@
1
+ @import "breakpoints";
2
+
3
+ @mixin color-variants($property, $prefix, $k, $v) {
4
+ .#{$prefix}-#{$k} {
5
+ #{$property}: $v;
6
+ }
7
+
8
+ .h\:#{$prefix}-#{$k} {
9
+ &:hover {
10
+ #{$property}: $v;
11
+ }
12
+ }
13
+ }
14
+
15
+ @mixin shade-variants($property, $prefix, $k, $v, $mod) {
16
+ @for $i from 1 through 6 {
17
+ // light variants
18
+ .#{$prefix}-l-#{$k}-#{$i} {
19
+ #{$property}: mix(white, $v, $i * $mod);
20
+ }
21
+
22
+ .h\:#{$prefix}-l-#{$k}-#{$i} {
23
+ &:hover {
24
+ #{$property}: mix(white, $v, $i * $mod);
25
+ }
26
+ }
27
+
28
+ // dark variants
29
+ .#{$prefix}-d-#{$k}-#{$i} {
30
+ #{$property}: mix(black, $v, $i * $mod);
31
+ }
32
+
33
+ .h\:#{$prefix}-d-#{$k}-#{$i} {
34
+ &:hover {
35
+ #{$property}: mix(black, $v, $i * $mod);
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ @mixin variants($property, $prefix, $unit) {
42
+ @for $i from 0 through 100 {
43
+ .#{$prefix}-#{$i} {
44
+ #{$property}: $i * $unit;
45
+ }
46
+
47
+ // Hover variant
48
+ .h\:#{$prefix}-#{$i}:hover {
49
+ #{$property}: $i * $unit;
50
+ }
51
+
52
+ @each $bp, $bp-value in $yma-breakpoints {
53
+ .#{$bp}\:#{$prefix}-#{$i} {
54
+ @include breakpoint($bp-value) {
55
+ #{$property}: $i * $unit;
56
+ }
57
+ }
58
+
59
+ // Responsive hover variant
60
+ .h\:#{$bp}\:#{$prefix}-#{$i}:hover {
61
+ @include breakpoint($bp-value) {
62
+ #{$property}: $i * $unit;
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ @mixin dimension-variants($prefix, $height-unit, $width-unit) {
70
+ @for $i from 0 through 100 {
71
+ .#{$prefix}-#{$i} {
72
+ height: $i * $height-unit;
73
+ width: $i * $width-unit;
74
+ }
75
+
76
+ // Hover variant
77
+ .h\:#{$prefix}-#{$i}:hover {
78
+ height: $i * $height-unit;
79
+ width: $i * $width-unit;
80
+ }
81
+
82
+ @each $bp, $bp-value in $yma-breakpoints {
83
+ .#{$bp}\:#{$prefix}-#{$i} {
84
+ @include breakpoint($bp-value) {
85
+ height: $i * $height-unit;
86
+ width: $i * $width-unit;
87
+ }
88
+ }
89
+
90
+ // Responsive hover variant
91
+ .h\:#{$bp}\:#{$prefix}-#{$i}:hover {
92
+ @include breakpoint($bp-value) {
93
+ height: $i * $height-unit;
94
+ width: $i * $width-unit;
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+ @mixin x-axis-variants($property, $prefix, $unit) {
102
+ @for $i from 0 through 100 {
103
+ .#{$prefix}-#{$i} {
104
+ #{$property}-left: $i * $unit;
105
+ #{$property}-right: $i * $unit;
106
+ }
107
+
108
+ // Hover variant
109
+ .h\:#{$prefix}-#{$i}:hover {
110
+ #{$property}-left: $i * $unit;
111
+ #{$property}-right: $i * $unit;
112
+ }
113
+
114
+ // Responsive variant
115
+ @each $bp, $bp-value in $yma-breakpoints {
116
+ .#{$bp}\:#{$prefix}-#{$i} {
117
+ @include breakpoint($bp-value) {
118
+ #{$property}-left: $i * $unit;
119
+ #{$property}-right: $i * $unit;
120
+ }
121
+ }
122
+
123
+ // Responsive hover variant
124
+ .h\:#{$bp}\:#{$prefix}-#{$i}:hover {
125
+ @include breakpoint($bp-value) {
126
+ #{$property}-left: $i * $unit;
127
+ #{$property}-right: $i * $unit;
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ @mixin y-axis-variants($property, $prefix, $unit) {
135
+ @for $i from 0 through 100 {
136
+ .#{$prefix}-#{$i} {
137
+ #{$property}-top: $i * $unit;
138
+ #{$property}-bottom: $i * $unit;
139
+ }
140
+
141
+ // Hover variant
142
+ .h\:#{$prefix}-#{$i}:hover {
143
+ #{$property}-top: $i * $unit;
144
+ #{$property}-bottom: $i * $unit;
145
+ }
146
+
147
+ // Responsive hover variant
148
+ @each $bp, $bp-value in $yma-breakpoints {
149
+ .#{$bp}\:#{$prefix}-#{$i} {
150
+ @include breakpoint($bp-value) {
151
+ #{$property}-top: $i * $unit;
152
+ #{$property}-bottom: $i * $unit;
153
+ }
154
+ }
155
+
156
+ // Responsive hover variant
157
+ .h\:#{$bp}\:#{$prefix}-#{$i}:hover {
158
+ @include breakpoint($bp-value) {
159
+ #{$property}-top: $i * $unit;
160
+ #{$property}-bottom: $i * $unit;
161
+ }
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ @mixin spacing-x($prefix, $unit) {
168
+ @for $i from 0 through 100 {
169
+ .#{$prefix}-#{$i} > :not([hidden]) ~ :not([hidden]) {
170
+ --yma-spacing-x: 1;
171
+ margin-left: calc(#{$i * $unit} * var(--yma-spacing-x));
172
+ margin-right: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-x)));
173
+ }
174
+
175
+ // Hover variant
176
+ .h\:#{$prefix}-#{$i}:hover > :not([hidden]) ~ :not([hidden]) {
177
+ --yma-spacing-x: 1;
178
+ margin-left: calc(#{$i * $unit} * var(--yma-spacing-x));
179
+ margin-right: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-x)));
180
+ }
181
+
182
+ // Responsive hover variant
183
+ @each $bp, $bp-value in $yma-breakpoints {
184
+ .#{$bp}\:#{$prefix}-#{$i} > :not([hidden]) ~ :not([hidden]) {
185
+ @include breakpoint($bp-value) {
186
+ --yma-spacing-x: 1;
187
+ margin-left: calc(#{$i * $unit} * var(--yma-spacing-x));
188
+ margin-right: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-x)));
189
+ }
190
+ }
191
+
192
+ // Responsive hover variant
193
+ .h\:#{$bp}\:#{$prefix}-#{$i}:hover > :not([hidden]) ~ :not([hidden]) {
194
+ @include breakpoint($bp-value) {
195
+ --yma-spacing-x: 1;
196
+ margin-left: calc(#{$i * $unit} * var(--yma-spacing-x));
197
+ margin-right: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-x)));
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ @mixin spacing-y($prefix, $unit) {
205
+ @for $i from 0 through 100 {
206
+ .#{$prefix}-#{$i} > :not([hidden]) ~ :not([hidden]) {
207
+ --yma-spacing-y: 1;
208
+ margin-top: calc(#{$i * $unit} * var(--yma-spacing-y));
209
+ margin-bottom: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-y)));
210
+ }
211
+
212
+ // Hover variant
213
+ .h\:#{$prefix}-#{$i}:hover > :not([hidden]) ~ :not([hidden]) {
214
+ --yma-spacing-y: 1;
215
+ margin-top: calc(#{$i * $unit} * var(--yma-spacing-y));
216
+ margin-bottom: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-y)));
217
+ }
218
+
219
+ // Responsive hover variant
220
+ @each $bp, $bp-value in $yma-breakpoints {
221
+ .#{$bp}\:#{$prefix}-#{$i} > :not([hidden]) ~ :not([hidden]) {
222
+ @include breakpoint($bp-value) {
223
+ --yma-spacing-y: 1;
224
+ margin-top: calc(#{$i * $unit} * var(--yma-spacing-y));
225
+ margin-bottom: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-y)));
226
+ }
227
+ }
228
+
229
+ // Responsive hover variant
230
+ .h\:#{$bp}\:#{$prefix}-#{$i}:hover > :not([hidden]) ~ :not([hidden]) {
231
+ @include breakpoint($bp-value) {
232
+ --yma-spacing-y: 1;
233
+ margin-top: calc(#{$i * $unit} * var(--yma-spacing-y));
234
+ margin-bottom: calc(#{$i * $unit} * calc(1 - var(--yma-spacing-y)));
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+
241
+ // Utility extensions
242
+ @mixin extensions($map, $prefixes) {
243
+ @each $k, $v in $map {
244
+ @each $prefix, $property in $prefixes {
245
+ .#{$prefix}-#{$k} {
246
+ #{$property}: $v;
247
+ }
248
+
249
+ // Hover variant
250
+ .h\:#{$prefix}-#{$k}:hover {
251
+ #{$property}: $v;
252
+ }
253
+
254
+ // Responsive hover variant
255
+ @each $bp, $bp-value in $yma-breakpoints {
256
+ .#{$bp}\:#{$prefix}-#{$k} {
257
+ @include breakpoint($bp-value) {
258
+ #{$property}: $v;
259
+ }
260
+ }
261
+
262
+ // Responsive hover variant
263
+ .h\:#{$bp}\:#{$prefix}-#{$k}:hover {
264
+ @include breakpoint($bp-value) {
265
+ #{$property}: $v;
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ @mixin dimension-extensions($map) {
274
+ @each $k, $v in $map {
275
+ .dim-#{$k} {
276
+ height: $v;
277
+ width: $v;
278
+ }
279
+
280
+ .h\:dim-#{$k}:hover {
281
+ height: $v;
282
+ width: $v;
283
+ }
284
+
285
+ .max-dim-#{$k} {
286
+ max-height: $v;
287
+ max-width: $v;
288
+ }
289
+
290
+ .h\:max-dim-#{$k}:hover {
291
+ max-height: $v;
292
+ max-width: $v;
293
+ }
294
+
295
+ .min-dim-#{$k} {
296
+ min-height: $v;
297
+ min-width: $v;
298
+ }
299
+
300
+ .h\:min-dim-#{$k}:hover {
301
+ min-height: $v;
302
+ min-width: $v;
303
+ }
304
+
305
+ @each $bp, $bp-value in $yma-breakpoints {
306
+ .#{$bp}\:dim-#{$k} {
307
+ @include breakpoint($bp-value) {
308
+ height: $v;
309
+ width: $v;
310
+ }
311
+ }
312
+
313
+ .h\:#{$bp}\:dim-#{$k}:hover {
314
+ @include breakpoint($bp-value) {
315
+ height: $v;
316
+ width: $v;
317
+ }
318
+ }
319
+
320
+ .#{$bp}\:max-dim-#{$k} {
321
+ @include breakpoint($bp-value) {
322
+ max-height: $v;
323
+ max-width: $v;
324
+ }
325
+ }
326
+
327
+ .h\:#{$bp}\:max-dim-#{$k}:hover {
328
+ @include breakpoint($bp-value) {
329
+ max-height: $v;
330
+ max-width: $v;
331
+ }
332
+ }
333
+
334
+ .#{$bp}\:min-dim-#{$k} {
335
+ @include breakpoint($bp-value) {
336
+ min-height: $v;
337
+ min-width: $v;
338
+ }
339
+ }
340
+
341
+ .h\:#{$bp}\:min-dim-#{$k}:hover {
342
+ @include breakpoint($bp-value) {
343
+ min-height: $v;
344
+ min-width: $v;
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }
350
+
351
+ @mixin spacing-extensions($map, $prefixes, $property) {
352
+ @each $k, $v in $map {
353
+ @if $k == "auto" {
354
+ @each $prefix in $prefixes {
355
+ .#{$prefix}-#{$k} {
356
+ #{$property}: $v;
357
+ }
358
+
359
+ .h\:#{$prefix}-#{$k}:hover {
360
+ #{$property}: $v;
361
+ }
362
+ }
363
+
364
+ .mx-#{$k} {
365
+ margin-left: $v;
366
+ margin-right: $v;
367
+ }
368
+
369
+ .h\:mx-#{$k}:hover {
370
+ margin-left: $v;
371
+ margin-right: $v;
372
+ }
373
+
374
+ .px-#{$k} {
375
+ padding-left: $v;
376
+ padding-right: $v;
377
+ }
378
+
379
+ .h\:px-#{$k}:hover {
380
+ padding-left: $v;
381
+ padding-right: $v;
382
+ }
383
+
384
+ .my-#{$k} {
385
+ margin-bottom: $v;
386
+ margin-top: $v;
387
+ }
388
+
389
+ .h\:my-#{$k}:hover {
390
+ margin-bottom: $v;
391
+ margin-top: $v;
392
+ }
393
+
394
+ .py-#{$k} {
395
+ padding-bottom: $v;
396
+ padding-top: $v;
397
+ }
398
+
399
+ .h\:py-#{$k}:hover {
400
+ padding-bottom: $v;
401
+ padding-top: $v;
402
+ }
403
+
404
+ @each $bp, $bp-value in $yma-breakpoints {
405
+ @each $prefix in $prefixes {
406
+ .#{$bp}\:#{$prefix}-#{$k} {
407
+ @include breakpoint($bp-value) {
408
+ #{$property}: $v;
409
+ }
410
+ }
411
+
412
+ .h\:#{$bp}\:#{$prefix}-#{$k}:hover {
413
+ @include breakpoint($bp-value) {
414
+ #{$property}: $v;
415
+ }
416
+ }
417
+ }
418
+
419
+ .#{$bp}\:mx-#{$k} {
420
+ @include breakpoint($bp-value) {
421
+ margin-left: $v;
422
+ margin-right: $v;
423
+ }
424
+ }
425
+
426
+ .h\:#{$bp}\:mx-#{$k}:hover {
427
+ @include breakpoint($bp-value) {
428
+ margin-left: $v;
429
+ margin-right: $v;
430
+ }
431
+ }
432
+
433
+ .#{$bp}\:px-#{$k} {
434
+ @include breakpoint($bp-value) {
435
+ padding-left: $v;
436
+ padding-right: $v;
437
+ }
438
+ }
439
+
440
+ .h\:#{$bp}\:px-#{$k}:hover {
441
+ @include breakpoint($bp-value) {
442
+ padding-left: $v;
443
+ padding-right: $v;
444
+ }
445
+ }
446
+
447
+ .#{$bp}\:my-#{$k} {
448
+ @include breakpoint($bp-value) {
449
+ margin-bottom: $v;
450
+ margin-top: $v;
451
+ }
452
+ }
453
+
454
+ .h\:#{$bp}\:my-#{$k}:hover {
455
+ @include breakpoint($bp-value) {
456
+ margin-bottom: $v;
457
+ margin-top: $v;
458
+ }
459
+ }
460
+
461
+ .#{$bp}\:py-#{$k} {
462
+ @include breakpoint($bp-value) {
463
+ padding-bottom: $v;
464
+ padding-top: $v;
465
+ }
466
+ }
467
+
468
+ .h\:#{$bp}\:py-#{$k}:hover {
469
+ @include breakpoint($bp-value) {
470
+ padding-bottom: $v;
471
+ padding-top: $v;
472
+ }
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+
479
+ @mixin height-extensions($map) {
480
+ @each $k, $v in $map {
481
+ .h-#{$k} {
482
+ height: $v;
483
+ }
484
+ .h\:h-#{$k}:hover {
485
+ height: $v;
486
+ }
487
+ .max-h-#{$k} {
488
+ max-height: $v;
489
+ }
490
+ .h\:max-h-#{$k}:hover {
491
+ max-height: $v;
492
+ }
493
+ .min-h-#{$k} {
494
+ min-height: $v;
495
+ }
496
+ .h\:min-h-#{$k}:hover {
497
+ min-height: $v;
498
+ }
499
+
500
+ @each $bp, $bp-value in $yma-breakpoints {
501
+ .#{$bp}\:h-#{$k} {
502
+ @include breakpoint($bp-value) {
503
+ height: $v;
504
+ }
505
+ }
506
+ .h\:#{$bp}\:h-#{$k}:hover {
507
+ @include breakpoint($bp-value) {
508
+ height: $v;
509
+ }
510
+ }
511
+ .#{$bp}\:max-h-#{$k} {
512
+ @include breakpoint($bp-value) {
513
+ max-height: $v;
514
+ }
515
+ }
516
+ .h\:#{$bp}\:max-h-#{$k}:hover {
517
+ @include breakpoint($bp-value) {
518
+ max-height: $v;
519
+ }
520
+ }
521
+ .#{$bp}\:min-h-#{$k} {
522
+ @include breakpoint($bp-value) {
523
+ min-height: $v;
524
+ }
525
+ }
526
+ .h\:#{$bp}\:min-h-#{$k}:hover {
527
+ @include breakpoint($bp-value) {
528
+ min-height: $v;
529
+ }
530
+ }
531
+ }
532
+ }
533
+ }
534
+
535
+ @mixin width-extensions($map) {
536
+ @each $k, $v in $map {
537
+ .w-#{$k} {
538
+ width: $v;
539
+ }
540
+ .h\:w-#{$k}:hover {
541
+ width: $v;
542
+ }
543
+ .max-w-#{$k} {
544
+ max-width: $v;
545
+ }
546
+ .h\:max-w-#{$k}:hover {
547
+ max-width: $v;
548
+ }
549
+ .min-w-#{$k} {
550
+ min-width: $v;
551
+ }
552
+ .h\:min-w-#{$k}:hover {
553
+ min-width: $v;
554
+ }
555
+
556
+ @each $bp, $bp-value in $yma-breakpoints {
557
+ .#{$bp}\:w-#{$k} {
558
+ @include breakpoint($bp-value) {
559
+ width: $v;
560
+ }
561
+ }
562
+ .h\:#{$bp}\:w-#{$k}:hover {
563
+ @include breakpoint($bp-value) {
564
+ width: $v;
565
+ }
566
+ }
567
+ .#{$bp}\:max-w-#{$k} {
568
+ @include breakpoint($bp-value) {
569
+ max-width: $v;
570
+ }
571
+ }
572
+ .h\:#{$bp}\:max-w-#{$k}:hover {
573
+ @include breakpoint($bp-value) {
574
+ max-width: $v;
575
+ }
576
+ }
577
+ .#{$bp}\:min-w-#{$k} {
578
+ @include breakpoint($bp-value) {
579
+ min-width: $v;
580
+ }
581
+ }
582
+ .h\:#{$bp}\:min-w-#{$k}:hover {
583
+ @include breakpoint($bp-value) {
584
+ min-width: $v;
585
+ }
586
+ }
587
+ }
588
+ }
589
+ }