@clayui/css 3.44.2 → 3.47.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.
Files changed (76) hide show
  1. package/README.md +23 -69
  2. package/lib/css/atlas.css +457 -86
  3. package/lib/css/atlas.css.map +1 -1
  4. package/lib/css/base.css +411 -68
  5. package/lib/css/base.css.map +1 -1
  6. package/lib/css/cadmin.css +204 -90
  7. package/lib/css/cadmin.css.map +1 -1
  8. package/lib/images/icons/add-cell.svg +1 -1
  9. package/lib/images/icons/corner-radius.svg +12 -0
  10. package/lib/images/icons/export.svg +11 -0
  11. package/lib/images/icons/font-family.svg +10 -0
  12. package/lib/images/icons/font-size.svg +10 -0
  13. package/lib/images/icons/icons.svg +1 -1
  14. package/lib/images/icons/shadow.svg +9 -0
  15. package/package.json +2 -2
  16. package/src/images/icons/add-cell.svg +1 -1
  17. package/src/images/icons/corner-radius.svg +12 -0
  18. package/src/images/icons/export.svg +11 -0
  19. package/src/images/icons/font-family.svg +10 -0
  20. package/src/images/icons/font-size.svg +10 -0
  21. package/src/images/icons/shadow.svg +9 -0
  22. package/src/scss/_components.scss +1 -0
  23. package/src/scss/_variables.scss +2 -0
  24. package/src/scss/atlas/variables/_buttons.scss +3 -0
  25. package/src/scss/atlas/variables/_cards.scss +12 -0
  26. package/src/scss/atlas/variables/_forms.scss +2 -1
  27. package/src/scss/atlas/variables/_globals.scss +42 -13
  28. package/src/scss/atlas/variables/_list-group.scss +28 -12
  29. package/src/scss/cadmin/_variables.scss +1 -0
  30. package/src/scss/cadmin/components/_aspect-ratio.scss +25 -38
  31. package/src/scss/cadmin/components/_cards.scss +10 -120
  32. package/src/scss/cadmin/components/_custom-forms.scss +4 -0
  33. package/src/scss/cadmin/components/_empty-state.scss +36 -0
  34. package/src/scss/cadmin/components/_forms.scss +1 -1
  35. package/src/scss/cadmin/components/_links.scss +1 -14
  36. package/src/scss/cadmin/components/_navs.scss +8 -0
  37. package/src/scss/cadmin/components/_treeview.scss +191 -210
  38. package/src/scss/cadmin/components/_type.scss +27 -42
  39. package/src/scss/cadmin/components/_utilities-functional-important.scss +35 -15
  40. package/src/scss/cadmin/variables/_aspect-ratio.scss +26 -0
  41. package/src/scss/cadmin/variables/_cards.scss +164 -1
  42. package/src/scss/cadmin/variables/_custom-forms.scss +3 -0
  43. package/src/scss/cadmin/variables/_empty-state.scss +23 -0
  44. package/src/scss/cadmin/variables/_forms.scss +3 -2
  45. package/src/scss/cadmin/variables/_globals.scss +173 -11
  46. package/src/scss/cadmin/variables/_links.scss +14 -0
  47. package/src/scss/cadmin/variables/_list-group.scss +32 -16
  48. package/src/scss/cadmin/variables/_sidebar.scss +1 -1
  49. package/src/scss/cadmin/variables/_treeview.scss +38 -17
  50. package/src/scss/cadmin/variables/_utilities.scss +42 -0
  51. package/src/scss/components/_aspect-ratio.scss +25 -38
  52. package/src/scss/components/_cards.scss +28 -122
  53. package/src/scss/components/_empty-state.scss +30 -0
  54. package/src/scss/components/_forms.scss +1 -1
  55. package/src/scss/components/_links.scss +12 -8
  56. package/src/scss/components/_tables.scss +0 -8
  57. package/src/scss/components/_treeview.scss +367 -0
  58. package/src/scss/components/_type.scss +27 -41
  59. package/src/scss/components/_utilities-functional-important.scss +35 -15
  60. package/src/scss/functions/_lx-icons-generated.scss +10 -0
  61. package/src/scss/mixins/_buttons.scss +4 -0
  62. package/src/scss/mixins/_cards.scss +59 -25
  63. package/src/scss/mixins/_grid.scss +29 -0
  64. package/src/scss/mixins/_links.scss +22 -2
  65. package/src/scss/variables/_aspect-ratio.scss +26 -0
  66. package/src/scss/variables/_buttons.scss +6 -0
  67. package/src/scss/variables/_cards.scss +158 -4
  68. package/src/scss/variables/_empty-state.scss +23 -0
  69. package/src/scss/variables/_forms.scss +3 -2
  70. package/src/scss/variables/_globals.scss +172 -11
  71. package/src/scss/variables/_links.scss +38 -3
  72. package/src/scss/variables/_list-group.scss +22 -12
  73. package/src/scss/variables/_sidebar.scss +3 -3
  74. package/src/scss/variables/_tables.scss +14 -0
  75. package/src/scss/variables/_treeview.scss +242 -0
  76. package/src/scss/variables/_utilities.scss +42 -0
@@ -435,26 +435,135 @@ $cadmin-font-weight-bolder: 900 !default;
435
435
  $cadmin-font-weight-base: $cadmin-font-weight-normal !default;
436
436
  $cadmin-line-height-base: 1.5 !default;
437
437
 
438
- $cadmin-h1-font-size: 26px !default; // 26px
439
- $cadmin-h2-font-size: 22px !default; // 22px
440
- $cadmin-h3-font-size: 19px !default; // 19px
441
- $cadmin-h4-font-size: 16px !default; // 16px
442
- $cadmin-h5-font-size: 14px !default; // 14px
443
- $cadmin-h6-font-size: 13px !default; // 13px
438
+ // h1, .h1
444
439
 
440
+ $cadmin-h1-font-size: 26px !default; // 26px
445
441
  $cadmin-h1-font-size-mobile: null !default;
442
+
443
+ $cadmin-h1: () !default;
444
+ $cadmin-h1: map-deep-merge(
445
+ (
446
+ font-size: $cadmin-h1-font-size,
447
+ media-breakpoint-down: (
448
+ sm: (
449
+ font-size: $cadmin-h1-font-size-mobile,
450
+ ),
451
+ ),
452
+ ),
453
+ $cadmin-h1
454
+ );
455
+
456
+ // h2, .h2
457
+
458
+ $cadmin-h2-font-size: 22px !default; // 22px
446
459
  $cadmin-h2-font-size-mobile: null !default;
460
+
461
+ $cadmin-h2: () !default;
462
+ $cadmin-h2: map-deep-merge(
463
+ (
464
+ font-size: $cadmin-h2-font-size,
465
+ media-breakpoint-down: (
466
+ sm: (
467
+ font-size: $cadmin-h2-font-size-mobile,
468
+ ),
469
+ ),
470
+ ),
471
+ $cadmin-h2
472
+ );
473
+
474
+ // h3, .h3
475
+
476
+ $cadmin-h3-font-size: 19px !default; // 19px
447
477
  $cadmin-h3-font-size-mobile: null !default;
478
+
479
+ $cadmin-h3: () !default;
480
+ $cadmin-h3: map-deep-merge(
481
+ (
482
+ font-size: $cadmin-h3-font-size,
483
+ media-breakpoint-down: (
484
+ sm: (
485
+ font-size: $cadmin-h3-font-size-mobile,
486
+ ),
487
+ ),
488
+ ),
489
+ $cadmin-h3
490
+ );
491
+
492
+ // h4, .h4
493
+
494
+ $cadmin-h4-font-size: 16px !default; // 16px
448
495
  $cadmin-h4-font-size-mobile: null !default;
496
+
497
+ $cadmin-h4: () !default;
498
+ $cadmin-h4: map-deep-merge(
499
+ (
500
+ font-size: $cadmin-h4-font-size,
501
+ media-breakpoint-down: (
502
+ sm: (
503
+ font-size: $cadmin-h4-font-size-mobile,
504
+ ),
505
+ ),
506
+ ),
507
+ $cadmin-h4
508
+ );
509
+
510
+ // h5, .h5
511
+
512
+ $cadmin-h5-font-size: 14px !default; // 14px
449
513
  $cadmin-h5-font-size-mobile: null !default;
514
+
515
+ $cadmin-h5: () !default;
516
+ $cadmin-h5: map-deep-merge(
517
+ (
518
+ font-size: $cadmin-h5-font-size,
519
+ media-breakpoint-down: (
520
+ sm: (
521
+ font-size: $cadmin-h5-font-size-mobile,
522
+ ),
523
+ ),
524
+ ),
525
+ $cadmin-h5
526
+ );
527
+
528
+ // h6, .h6
529
+
530
+ $cadmin-h6-font-size: 13px !default; // 13px
450
531
  $cadmin-h6-font-size-mobile: null !default;
451
532
 
533
+ $cadmin-h6: () !default;
534
+ $cadmin-h6: map-deep-merge(
535
+ (
536
+ font-size: $cadmin-h6-font-size,
537
+ media-breakpoint-down: (
538
+ sm: (
539
+ font-size: $cadmin-h6-font-size-mobile,
540
+ ),
541
+ ),
542
+ ),
543
+ $cadmin-h6
544
+ );
545
+
546
+ // Headings h1-h6
547
+
452
548
  $cadmin-headings-margin-bottom: $cadmin-spacer * 0.5 !default;
453
549
  $cadmin-headings-font-family: null !default;
454
550
  $cadmin-headings-font-weight: $cadmin-font-weight-bold !default;
455
551
  $cadmin-headings-line-height: 1.2 !default;
456
552
  $cadmin-headings-color: null !default;
457
553
 
554
+ $cadmin-headings: () !default;
555
+ $cadmin-headings: map-deep-merge(
556
+ (
557
+ color: $cadmin-headings-color,
558
+ font-family: $cadmin-headings-font-family,
559
+ font-weight: $cadmin-headings-font-weight,
560
+ line-height: $cadmin-headings-line-height,
561
+ margin-bottom: $cadmin-headings-margin-bottom,
562
+ margin-top: 0,
563
+ ),
564
+ $cadmin-headings
565
+ );
566
+
458
567
  // This is similar to the html and body tag allows you to isolate all styles inside it.
459
568
 
460
569
  $cadmin: () !default;
@@ -590,16 +699,69 @@ $cadmin-emphasized-link-hover-darken-percentage: 15% !default;
590
699
 
591
700
  $cadmin-paragraph-margin-bottom: 16px !default;
592
701
 
593
- $cadmin-display1-size: 96px !default;
594
- $cadmin-display2-size: 88px !default;
595
- $cadmin-display3-size: 72px !default;
596
- $cadmin-display4-size: 56px !default;
702
+ // Display
703
+
704
+ $cadmin-display-line-height: $cadmin-headings-line-height !default;
705
+
706
+ // .display-1
597
707
 
708
+ $cadmin-display1-size: 96px !default;
598
709
  $cadmin-display1-weight: 300 !default;
710
+
711
+ $cadmin-display-1: () !default;
712
+ $cadmin-display-1: map-deep-merge(
713
+ (
714
+ font-size: $cadmin-display1-size,
715
+ font-weight: $cadmin-display1-weight,
716
+ line-height: $cadmin-display-line-height,
717
+ ),
718
+ $cadmin-display-1
719
+ );
720
+
721
+ // .display-2
722
+
723
+ $cadmin-display2-size: 88px !default;
599
724
  $cadmin-display2-weight: 300 !default;
725
+
726
+ $cadmin-display-2: () !default;
727
+ $cadmin-display-2: map-deep-merge(
728
+ (
729
+ font-size: $cadmin-display2-size,
730
+ font-weight: $cadmin-display2-weight,
731
+ line-height: $cadmin-display-line-height,
732
+ ),
733
+ $cadmin-display-2
734
+ );
735
+
736
+ // .display-3
737
+
738
+ $cadmin-display3-size: 72px !default;
600
739
  $cadmin-display3-weight: 300 !default;
740
+
741
+ $cadmin-display-3: () !default;
742
+ $cadmin-display-3: map-deep-merge(
743
+ (
744
+ font-size: $cadmin-display3-size,
745
+ font-weight: $cadmin-display3-weight,
746
+ line-height: $cadmin-display-line-height,
747
+ ),
748
+ $cadmin-display-3
749
+ );
750
+
751
+ // .display-4
752
+
753
+ $cadmin-display4-size: 56px !default;
601
754
  $cadmin-display4-weight: 300 !default;
602
- $cadmin-display-line-height: $cadmin-headings-line-height !default;
755
+
756
+ $cadmin-display-4: () !default;
757
+ $cadmin-display-4: map-deep-merge(
758
+ (
759
+ font-size: $cadmin-display4-size,
760
+ font-weight: $cadmin-display4-weight,
761
+ line-height: $cadmin-display-line-height,
762
+ ),
763
+ $cadmin-display-4
764
+ );
603
765
 
604
766
  $cadmin-lead-font-size: $cadmin-font-size-base * 1.25 !default;
605
767
  $cadmin-lead-font-weight: 300 !default;
@@ -252,6 +252,13 @@ $cadmin-component-title-link: map-deep-merge(
252
252
  $cadmin-component-title-link
253
253
  );
254
254
 
255
+ $cadmin-component-title: map-deep-merge(
256
+ $cadmin-component-title,
257
+ (
258
+ href: $cadmin-component-title-link,
259
+ )
260
+ );
261
+
255
262
  // Component Subtitle
256
263
 
257
264
  $cadmin-component-subtitle: () !default;
@@ -283,6 +290,13 @@ $cadmin-component-subtitle-link: map-deep-merge(
283
290
  $cadmin-component-subtitle-link
284
291
  );
285
292
 
293
+ $cadmin-component-subtitle: map-deep-merge(
294
+ $cadmin-component-subtitle,
295
+ (
296
+ href: $cadmin-component-subtitle-link,
297
+ )
298
+ );
299
+
286
300
  // Component Action
287
301
 
288
302
  $cadmin-component-action: () !default;
@@ -73,9 +73,13 @@ $cadmin-list-group-title-link: map-deep-merge(
73
73
  display: inline-block,
74
74
  transition: box-shadow 0.15s ease-in-out,
75
75
  max-width: 100%,
76
- hover-color: $cadmin-gray-900,
77
- focus-box-shadow: $cadmin-component-focus-box-shadow,
78
- focus-outline: 0,
76
+ hover: (
77
+ color: $cadmin-gray-900,
78
+ ),
79
+ focus: (
80
+ box-shadow: $cadmin-component-focus-box-shadow,
81
+ outline: 0,
82
+ ),
79
83
  ),
80
84
  $cadmin-list-group-title-link
81
85
  );
@@ -89,7 +93,7 @@ $cadmin-list-group-title: map-deep-merge(
89
93
  line-height: 1.45,
90
94
  margin-bottom: 0,
91
95
  margin-top: $cadmin-list-group-item-flex-list-group-title-offset-top,
92
- clay-link: $cadmin-list-group-title-link,
96
+ href: $cadmin-list-group-title-link,
93
97
  ),
94
98
  $cadmin-list-group-title
95
99
  );
@@ -106,9 +110,13 @@ $cadmin-list-group-subtitle-link: map-deep-merge(
106
110
  display: inline-block,
107
111
  max-width: 100%,
108
112
  transition: box-shadow 0.15s ease-in-out,
109
- hover-color: $cadmin-gray-900,
110
- focus-box-shadow: $cadmin-component-focus-box-shadow,
111
- focus-outline: 0,
113
+ hover: (
114
+ color: $cadmin-gray-900,
115
+ ),
116
+ focus: (
117
+ box-shadow: $cadmin-component-focus-box-shadow,
118
+ outline: 0,
119
+ ),
112
120
  ),
113
121
  $cadmin-list-group-subtitle-link
114
122
  );
@@ -118,7 +126,7 @@ $cadmin-list-group-subtitle: map-deep-merge(
118
126
  (
119
127
  color: $cadmin-gray-600,
120
128
  margin-bottom: 0,
121
- clay-link: $cadmin-list-group-subtitle-link,
129
+ href: $cadmin-list-group-subtitle-link,
122
130
  ),
123
131
  $cadmin-list-group-subtitle
124
132
  );
@@ -133,9 +141,13 @@ $cadmin-list-group-text-link: map-deep-merge(
133
141
  display: inline-block,
134
142
  max-width: 100%,
135
143
  transition: box-shadow 0.15s ease-in-out,
136
- hover-color: $cadmin-gray-900,
137
- focus-box-shadow: $cadmin-component-focus-box-shadow,
138
- focus-outline: 0,
144
+ hover: (
145
+ color: $cadmin-gray-900,
146
+ ),
147
+ focus: (
148
+ box-shadow: $cadmin-component-focus-box-shadow,
149
+ outline: 0,
150
+ ),
139
151
  ),
140
152
  $cadmin-list-group-text-link
141
153
  );
@@ -146,7 +158,7 @@ $cadmin-list-group-text: map-deep-merge(
146
158
  color: $cadmin-gray-900,
147
159
  line-height: 1.45,
148
160
  margin-bottom: 0,
149
- clay-link: $cadmin-list-group-text-link,
161
+ href: $cadmin-list-group-text-link,
150
162
  ),
151
163
  $cadmin-list-group-text
152
164
  );
@@ -163,9 +175,13 @@ $cadmin-list-group-subtext-link: map-deep-merge(
163
175
  display: inline-block,
164
176
  max-width: 100%,
165
177
  transition: box-shadow 0.15s ease-in-out,
166
- hover-color: $cadmin-gray-900,
167
- focus-box-shadow: $cadmin-component-focus-box-shadow,
168
- focus-outline: 0,
178
+ hover: (
179
+ color: $cadmin-gray-900,
180
+ ),
181
+ focus: (
182
+ box-shadow: $cadmin-component-focus-box-shadow,
183
+ outline: 0,
184
+ ),
169
185
  ),
170
186
  $cadmin-list-group-subtext-link
171
187
  );
@@ -176,7 +192,7 @@ $cadmin-list-group-subtext: map-deep-merge(
176
192
  color: $cadmin-gray-600,
177
193
  line-height: 1.45,
178
194
  margin-bottom: 0,
179
- clay-link: $cadmin-list-group-subtext-link,
195
+ href: $cadmin-list-group-subtext-link,
180
196
  ),
181
197
  $cadmin-list-group-subtext
182
198
  );
@@ -10,7 +10,7 @@ $cadmin-sidebar-header-component-title: map-deep-merge(
10
10
  (
11
11
  font-size: 20px,
12
12
  font-weight: $cadmin-font-weight-semi-bold,
13
- clay-link: (
13
+ href: (
14
14
  color: $cadmin-gray-900,
15
15
  ),
16
16
  ),
@@ -42,7 +42,17 @@ $cadmin-treeview: map-merge(
42
42
  treeview-item: (
43
43
  word-wrap: break-word,
44
44
  ),
45
- link: (
45
+ treeview-item-dragging: (
46
+ cursor: $cadmin-disabled-cursor,
47
+ opacity: 0.4,
48
+ treeview-link: (
49
+ background-color: transparent,
50
+ border-color: transparent,
51
+ box-shadow: none,
52
+ ),
53
+ ),
54
+ treeview-link: (
55
+ background-color: transparent,
46
56
  cursor: pointer,
47
57
  display: block,
48
58
  border-color: transparent,
@@ -53,20 +63,17 @@ $cadmin-treeview: map-merge(
53
63
  min-width: 100%,
54
64
  padding: 0,
55
65
  position: relative,
66
+ text-align: left,
56
67
  user-select: none,
57
- dropping: (
58
- bottom: (
59
- border-bottom-width: 2px,
60
- border-bottom-color: $cadmin-primary-l1,
61
- ),
62
- middle: (
63
- background-color: $cadmin-primary-l3,
64
- border-color: $cadmin-primary-l1,
65
- ),
66
- top: (
67
- border-top-color: $cadmin-primary-l1,
68
- border-top-width: 2px,
69
- ),
68
+ treeview-dropping-bottom: (
69
+ box-shadow: 0 2px 0 0 $cadmin-primary-l1,
70
+ ),
71
+ treeview-dropping-middle: (
72
+ background-color: $cadmin-primary-l3,
73
+ border-color: $cadmin-primary-l1,
74
+ ),
75
+ treeview-dropping-top: (
76
+ box-shadow: 0 -2px 0 0 $cadmin-primary-l1,
70
77
  ),
71
78
  hover: (
72
79
  text-decoration: none,
@@ -75,6 +82,9 @@ $cadmin-treeview: map-merge(
75
82
  box-shadow: $cadmin-component-focus-inset-box-shadow,
76
83
  outline: 0,
77
84
  ),
85
+ disabled: (
86
+ cursor: $cadmin-disabled-cursor,
87
+ ),
78
88
  ),
79
89
  component-action: (
80
90
  display: none,
@@ -155,11 +165,15 @@ $cadmin-treeview-light: map-deep-merge(
155
165
  hover: (
156
166
  color: $cadmin-primary,
157
167
  ),
168
+ disabled: (
169
+ color: $cadmin-secondary,
170
+ opacity: 0.5,
171
+ ),
158
172
  btn-secondary: (
159
173
  background-color: $cadmin-white,
160
174
  ),
161
175
  ),
162
- link: (
176
+ treeview-link: (
163
177
  color: $cadmin-gray-600,
164
178
  hover: (
165
179
  background-color: $cadmin-gray-100,
@@ -173,6 +187,10 @@ $cadmin-treeview-light: map-deep-merge(
173
187
  background-color: $cadmin-gray-200,
174
188
  color: $cadmin-gray-900,
175
189
  ),
190
+ disabled: (
191
+ background-color: transparent,
192
+ color: rgba($cadmin-gray-600, 0.5),
193
+ ),
176
194
  show: (
177
195
  background-color: null,
178
196
  color: null,
@@ -191,7 +209,7 @@ $cadmin-treeview-dark: map-deep-merge(
191
209
  color: $cadmin-primary-l1,
192
210
  ),
193
211
  ),
194
- link: (
212
+ treeview-link: (
195
213
  color: $cadmin-secondary-l1,
196
214
  hover: (
197
215
  background-color: rgba($cadmin-white, 0.04),
@@ -202,7 +220,7 @@ $cadmin-treeview-dark: map-deep-merge(
202
220
  ),
203
221
  disabled: (
204
222
  background-color: transparent,
205
- color: rgba($cadmin-secondary-l1, 0.04),
223
+ color: rgba($cadmin-secondary-l1, 0.5),
206
224
  ),
207
225
  show: (
208
226
  background-color: null,
@@ -211,6 +229,9 @@ $cadmin-treeview-dark: map-deep-merge(
211
229
  ),
212
230
  component-action: (
213
231
  color: $cadmin-secondary-l1,
232
+ disabled: (
233
+ color: $cadmin-secondary-l1,
234
+ ),
214
235
  ),
215
236
  ),
216
237
  $cadmin-treeview-dark
@@ -141,3 +141,45 @@ $cadmin-overflows: auto, hidden !default;
141
141
  // Position
142
142
 
143
143
  $cadmin-positions: static, relative, absolute, fixed, sticky !default;
144
+
145
+ // Font Sizes
146
+
147
+ $cadmin-font-sizes: () !default;
148
+ $cadmin-font-sizes: map-deep-merge(
149
+ (
150
+ text-1: (
151
+ font-size: 0.625rem,
152
+ ),
153
+ text-2: (
154
+ font-size: 0.75rem,
155
+ ),
156
+ text-3: (
157
+ font-size: 0.875rem,
158
+ ),
159
+ text-4: (
160
+ font-size: 1rem,
161
+ ),
162
+ text-5: (
163
+ font-size: 1.125rem,
164
+ ),
165
+ text-6: (
166
+ font-size: 1.25rem,
167
+ ),
168
+ text-7: (
169
+ font-size: 1.5rem,
170
+ ),
171
+ text-8: (
172
+ font-size: 1.75rem,
173
+ ),
174
+ text-9: (
175
+ font-size: 2rem,
176
+ ),
177
+ text-10: (
178
+ font-size: 2.25rem,
179
+ ),
180
+ text-11: (
181
+ font-size: 2.5rem,
182
+ ),
183
+ ),
184
+ $cadmin-font-sizes
185
+ );
@@ -158,44 +158,31 @@
158
158
  @extend %aspect-ratio-item-center-middle;
159
159
  }
160
160
 
161
- // 3 to 2
162
-
163
- %aspect-ratio-3-to-2 {
164
- @include clay-aspect-ratio(3, 2);
165
- }
166
-
167
- .aspect-ratio-3-to-2 {
168
- @extend %aspect-ratio-3-to-2;
169
- }
170
-
171
- // 4 to 3
172
-
173
- %aspect-ratio-4-to-3 {
174
- @include clay-aspect-ratio(4, 3);
175
- }
176
-
177
- .aspect-ratio-4-to-3 {
178
- @extend %aspect-ratio-4-to-3;
179
- }
180
-
181
- // 8 to 5
182
-
183
- %aspect-ratio-8-to-5 {
184
- @include clay-aspect-ratio(8, 5);
185
- }
186
-
187
- .aspect-ratio-8-to-5 {
188
- @extend %aspect-ratio-8-to-5;
189
- }
190
-
191
- // 16 to 9
192
-
193
- %aspect-ratio-16-to-9 {
194
- @include clay-aspect-ratio(16, 9);
195
- }
196
-
197
- .aspect-ratio-16-to-9 {
198
- @extend %aspect-ratio-16-to-9;
161
+ // aspect-ratio-#-to-#
162
+
163
+ @each $selector, $value in $aspect-ratio-sizes {
164
+ $selector: if(
165
+ starts-with($selector, '.') or starts-with($selector, '#'),
166
+ $selector,
167
+ str-insert($selector, '.', 1)
168
+ );
169
+
170
+ $placeholder: str-insert(
171
+ str-slice($selector, 2, str-length($selector)),
172
+ '%',
173
+ 1
174
+ );
175
+
176
+ #{$placeholder} {
177
+ @include clay-aspect-ratio(
178
+ map-get($value, width),
179
+ map-get($value, height)
180
+ );
181
+ }
182
+
183
+ #{$selector} {
184
+ @extend #{$placeholder} !optional;
185
+ }
199
186
  }
200
187
 
201
188
  // Bg Contain