We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46a727e commit 2d440c0Copy full SHA for 2d440c0
5 files changed
src/Utilities/_config/_specs.scss
@@ -4,11 +4,22 @@
4
///
5
6
$specs: (
7
- "spaces" : (0,5,10,15,20,30,40,50,75,100,125,150,175,200), // padding and margin (px)
+ "spaces" : (0,5,10,15,20,30,40,50,75,100,125,150,175,200), // padding and margin (px)
8
"font-weight" : (100,200,300,400,500,600,700,800,900,normal,bold,bolder,lighter),
9
"borders" : (0,1,2,3,4,5), // border width (px)
10
"border-radius" : (2,4,8,10,12,14,16,500), // (px)
11
"orders" : (1,2,3,4,5),
12
"line-height" : (0,1,2,3,4,5),
13
- "z-index" : (-1,0,1,10,20,30,40,50,100,999,9999,99999)
+ "z-index" : (-1,0,1,10,20,30,40,50,100,999,9999,99999),
14
+ "sizes" : (
15
+ // used for padding, margin, width and height
16
+ ("tiny", 1rem), // 16px
17
+ ("mini", 2rem), // 32px
18
+ ("small", 4rem), // 64px
19
+ ("large", 8rem), // 128px
20
+ ("big", 10rem), // 160px
21
+ ("huge", 12rem), // 190px
22
+ ("massive", 18rem), // 288px
23
+ ("giant", 24rem) // 384px
24
+ ),
25
);
src/Utilities/_config/height.scss
@@ -12,10 +12,4 @@ $height-helpers: (
("height-50", 50%),
("height-75", 75%),
("height-100", 100%),
- ("tiny-height", 1rem), // 16px
- ("mini-height", 2rem), // 32px
- ("small-height", 4rem), // 64px
- ("large-height", 8rem), // 128px
- ("huge-height", 12rem), // 190px
- ("giant-height", 24rem) // 384px
src/Utilities/_config/width.scss
@@ -9,13 +9,9 @@ $width-helpers: (
("width-max-content", max-content),
("width-fit-content", fit-content),
("width-25", 25%),
+ ("width-33", 33%),
("width-50", 50%),
+ ("width-66", 66%),
("width-75", 75%),
("width-100", 100%),
- ("tiny-width", 1rem), // 16px
- ("mini-width", 2rem), // 32px
- ("small-width", 4rem), // 64px
- ("large-width", 8rem), // 128px
- ("huge-width", 12rem), // 192px
- ("giant-width", 24rem) // 384px
src/Utilities/helpers.scss
@@ -5,6 +5,7 @@
@use "variables" as *;
@use "mixins" as *;
+@use "../_global/_getters" as *;
@if options('helpers', 'enable') {
/// Align Items
@@ -68,6 +69,7 @@
68
69
70
/// Height
71
@include setHelperList($height-helpers, "height", "!important");
72
+ @include setSizeHelpers(null, specs('sizes'), "height");
73
74
/// Inset
75
@include setNestedHelperList($insets);
@@ -86,6 +88,7 @@
86
88
87
89
/// Margin
90
@include setHelperListWithRange($margin-helpers, specs('spaces'), "px", "!important");
91
+ @include setSizeHelpers($margin-helpers, specs('sizes'));
92
@include setHelperListWithRange($margin-helpers, auto, null, "!important"); // margin auto
93
94
/// Object-Fit
@@ -100,6 +103,7 @@
100
103
101
104
/// Padding
102
105
@include setHelperListWithRange($padding-helpers, specs('spaces'), "px", "!important");
106
+ @include setSizeHelpers($padding-helpers, specs('sizes'));
107
@include setHelperListWithRange($padding-helpers, auto, null, "!important"); // padding auto
108
109
/// Place Content
@@ -135,6 +139,7 @@
135
139
136
140
/// Width
137
141
@include setHelperList($width-helpers, "width", "!important");
142
+ @include setSizeHelpers(null, specs('sizes'), "width");
138
143
144
/// Z-Index
145
@include setHelperListWithRange($z-indexes, specs('z-index'), null, "!important");
src/Utilities/mixins.scss
@@ -103,6 +103,31 @@
}
+///
+/// Set Size Helpers
+/// @param {List} $list
+/// @param {List} $sizes
110
+/// @param {String} $suffix (must also be a name of css property)
111
112
+@mixin setSizeHelpers($list: null, $sizes: null, $suffix: null) {
113
+
114
+ @if $suffix {
115
+ @each $name, $value in $sizes {
116
+ .#{$name}-#{$suffix} {
117
+ @include setProperties($suffix, $value, null, "!important");
118
+ }
119
120
+ } @else {
121
+ @each $classname, $prop in $list {
122
123
+ .#{$classname}#{$name} {
124
+ @include setProperties($prop, $value, null, "!important");
125
126
127
128
129
+}
130
131
132
/// Set Properties
133
/// @param {Property|String} $property
0 commit comments