@stackoverflow/stacks 3.0.0-beta.2 → 3.0.0-beta.21
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/dist/css/stacks.css +6068 -5972
- package/dist/css/stacks.min.css +1 -1
- package/lib/atomic/flex.less +6 -34
- package/lib/atomic/height.less +22 -0
- package/lib/atomic/misc.less +21 -15
- package/lib/atomic/positioning.less +34 -0
- package/lib/atomic/sizing.less +76 -0
- package/lib/atomic/spacing.less +35 -75
- package/lib/atomic/typography.less +52 -13
- package/lib/atomic/width.less +27 -0
- package/lib/base/body.less +2 -4
- package/lib/base/configuration-static.less +3 -3
- package/lib/base/internal.less +3 -5
- package/lib/base/reset-normalize.less +1 -1
- package/lib/components/activity-indicator/activity-indicator.less +1 -17
- package/lib/components/avatar/avatar.less +2 -2
- package/lib/components/badge/badge.less +179 -173
- package/lib/components/banner/banner.less +11 -10
- package/lib/components/bling/bling.less +130 -0
- package/lib/components/button/button.less +233 -376
- package/lib/components/button-group/button-group.less +2 -1
- package/lib/components/checkbox_radio/checkbox_radio.less +195 -113
- package/lib/components/code-block/code-block.fixtures.ts +2 -2
- package/lib/components/code-block/code-block.less +1 -1
- package/lib/components/description/description.less +15 -1
- package/lib/components/empty-state/empty-state.less +17 -6
- package/lib/components/form-group/form-group.less +25 -0
- package/lib/components/input-icon/input-icon.less +3 -3
- package/lib/components/input_textarea/input_textarea.less +71 -58
- package/lib/components/menu/menu.less +83 -21
- package/lib/components/modal/modal.less +10 -10
- package/lib/components/navigation/navigation.less +62 -37
- package/lib/components/notice/notice.less +89 -74
- package/lib/components/pagination/pagination.less +44 -43
- package/lib/components/popover/popover.less +8 -10
- package/lib/components/post-summary/post-summary.less +6 -5
- package/lib/components/progress-bar/progress-bar.less +1 -1
- package/lib/components/prose/prose.less +5 -5
- package/lib/components/select/select.less +26 -37
- package/lib/components/sidebar-widget/sidebar-widget.less +2 -2
- package/lib/components/table/table.less +0 -8
- package/lib/components/tag/tag.less +69 -71
- package/lib/components/toast/toast.less +4 -2
- package/lib/components/topbar/topbar.less +4 -4
- package/lib/components/user-card/user-card.less +118 -92
- package/lib/components/vote/vote.less +134 -0
- package/lib/exports/color-sets.less +78 -77
- package/lib/exports/constants-helpers.less +4 -8
- package/lib/exports/constants-type.less +18 -36
- package/lib/exports/mixins.less +71 -0
- package/lib/stacks-static.less +7 -5
- package/lib/test/visual-test-utils.ts +42 -10
- package/lib/tsconfig.json +1 -1
- package/package.json +1 -1
- package/lib/atomic/width-height.less +0 -194
- package/lib/components/award-bling/award-bling.less +0 -32
- package/lib/components/check-control/check-control.less +0 -17
- package/lib/components/check-group/check-group.less +0 -19
- package/lib/components/skeleton/skeleton.less +0 -73
- package/lib/exports/spacing-mixins.less +0 -67
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// STACK OVERFLOW
|
|
3
|
-
// WIDTH & HEIGHT
|
|
4
|
-
//
|
|
5
|
-
// This CSS comes from Stacks, our CSS & Pattern library for rapidly building
|
|
6
|
-
// Stack Overflow. For documentation of all these classes and how to contribute,
|
|
7
|
-
// visit https://stackoverflow.design/
|
|
8
|
-
//
|
|
9
|
-
// • WIDTH
|
|
10
|
-
// • PERCENTAGE
|
|
11
|
-
// • STATIC
|
|
12
|
-
// • MAX-WIDTH
|
|
13
|
-
// • MIN-WIDTH
|
|
14
|
-
// • HEIGHT
|
|
15
|
-
// • PERCENTAGE
|
|
16
|
-
// • STATIC
|
|
17
|
-
// • MAX-HEIGHT
|
|
18
|
-
// • MIN-HEIGHT
|
|
19
|
-
//
|
|
20
|
-
// ============================================================================
|
|
21
|
-
// $ WIDTH
|
|
22
|
-
// ----------------------------------------------------------------------------
|
|
23
|
-
// $$ PERCENTAGE AND VIEWPORT UNITS
|
|
24
|
-
.w0 { width: 0 !important; }
|
|
25
|
-
.w10 { width: 10% !important; }
|
|
26
|
-
.w20 { width: 20% !important; }
|
|
27
|
-
#stacks-internals #responsify('.w25', { width: 25% !important; });
|
|
28
|
-
.w30 { width: 30% !important; }
|
|
29
|
-
#stacks-internals #responsify('.w33', { width: 33.33333% !important; });
|
|
30
|
-
.w40 { width: 40% !important; }
|
|
31
|
-
#stacks-internals #responsify('.w50', { width: 50% !important; });
|
|
32
|
-
.w60 { width: 60% !important; }
|
|
33
|
-
#stacks-internals #responsify('.w66', { width: 66.66667% !important; });
|
|
34
|
-
.w70 { width: 70% !important; }
|
|
35
|
-
#stacks-internals #responsify('.w75', { width: 75% !important; });
|
|
36
|
-
.w80 { width: 80% !important; }
|
|
37
|
-
.w90 { width: 90% !important; }
|
|
38
|
-
#stacks-internals #responsify('.w100', { width: 100% !important; });
|
|
39
|
-
#stacks-internals #responsify('.w-auto', { width: auto !important; });
|
|
40
|
-
#stacks-internals #responsify('.w-screen', { width: 100vw !important; });
|
|
41
|
-
|
|
42
|
-
// $$ STATIC
|
|
43
|
-
.ws0,
|
|
44
|
-
.w0 { width: 0 !important; }
|
|
45
|
-
.ws1 { width: var(--s-step) !important; }
|
|
46
|
-
.ws2 { width: calc(var(--s-step) * 2) !important; }
|
|
47
|
-
.ws3 { width: calc(var(--s-step) * 3) !important; }
|
|
48
|
-
.ws4 { width: calc(var(--s-step) * 4) !important; }
|
|
49
|
-
.ws5 { width: calc(var(--s-step) * 5) !important; }
|
|
50
|
-
.ws6 { width: calc(var(--s-step) * 6) !important; }
|
|
51
|
-
.ws7 { width: calc(var(--s-step) * 7) !important; }
|
|
52
|
-
.ws8 { width: calc(var(--s-step) * 8) !important; }
|
|
53
|
-
.ws9 { width: calc(var(--s-step) * 9) !important; }
|
|
54
|
-
.ws10 { width: calc(var(--s-step) * 10) !important; }
|
|
55
|
-
.ws11 { width: calc(var(--s-step) * 11) !important; }
|
|
56
|
-
.ws12 { width: var(--s-full) !important; }
|
|
57
|
-
|
|
58
|
-
// $$ SPACING UNITS
|
|
59
|
-
.w2 { width: var(--su-static2) !important; }
|
|
60
|
-
.w4 { width: var(--su-static4) !important; }
|
|
61
|
-
.w6 { width: var(--su-static6) !important; }
|
|
62
|
-
.w8 { width: var(--su-static8) !important; }
|
|
63
|
-
.w12 { width: var(--su-static12) !important; }
|
|
64
|
-
.w16 { width: var(--su-static16) !important; }
|
|
65
|
-
.w24 { width: var(--su-static24) !important; }
|
|
66
|
-
.w32 { width: var(--su-static32) !important; }
|
|
67
|
-
.w48 { width: var(--su-static48) !important; }
|
|
68
|
-
.w64 { width: var(--su-static64) !important; }
|
|
69
|
-
.w96 { width: var(--su-static96) !important; }
|
|
70
|
-
.w128 { width: var(--su-static128) !important; }
|
|
71
|
-
|
|
72
|
-
// ============================================================================
|
|
73
|
-
// $ MAX-WIDTH
|
|
74
|
-
// ----------------------------------------------------------------------------
|
|
75
|
-
.wmx0 { max-width: 0 !important; }
|
|
76
|
-
.wmx1 { max-width: var(--s-step) !important; }
|
|
77
|
-
.wmx2 { max-width: calc(var(--s-step) * 2) !important; }
|
|
78
|
-
.wmx25 { max-width: 25% !important; }
|
|
79
|
-
.wmx3 { max-width: calc(var(--s-step) * 3) !important; }
|
|
80
|
-
.wmx4 { max-width: calc(var(--s-step) * 4) !important; }
|
|
81
|
-
.wmx5 { max-width: calc(var(--s-step) * 5) !important; }
|
|
82
|
-
.wmx50 { max-width: 50% !important; }
|
|
83
|
-
.wmx6 { max-width: calc(var(--s-step) * 6) !important; }
|
|
84
|
-
.wmx7 { max-width: calc(var(--s-step) * 7) !important; }
|
|
85
|
-
.wmx75 { max-width: 75% !important; }
|
|
86
|
-
.wmx8 { max-width: calc(var(--s-step) * 8) !important; }
|
|
87
|
-
.wmx9 { max-width: calc(var(--s-step) * 9) !important; }
|
|
88
|
-
.wmx10 { max-width: calc(var(--s-step) * 10) !important; }
|
|
89
|
-
.wmx11 { max-width: calc(var(--s-step) * 11) !important; }
|
|
90
|
-
.wmx12 { max-width: var(--s-full) !important; }
|
|
91
|
-
#stacks-internals #responsify('.wmx100', { max-width: 100% !important; });
|
|
92
|
-
#stacks-internals #responsify('.wmx-initial', { max-width: initial !important; });
|
|
93
|
-
#stacks-internals #responsify('.wmx-screen', { max-width: 100vw !important; });
|
|
94
|
-
|
|
95
|
-
// ============================================================================
|
|
96
|
-
// $ MIN-WIDTH
|
|
97
|
-
// ----------------------------------------------------------------------------
|
|
98
|
-
.wmn0 { min-width: 0 !important; }
|
|
99
|
-
.wmn1 { min-width: var(--s-step) !important; }
|
|
100
|
-
.wmn2 { min-width: calc(var(--s-step) * 2) !important; }
|
|
101
|
-
.wmn25 { min-width: 25% !important; }
|
|
102
|
-
.wmn3 { min-width: calc(var(--s-step) * 3) !important; }
|
|
103
|
-
.wmn4 { min-width: calc(var(--s-step) * 4) !important; }
|
|
104
|
-
.wmn5 { min-width: calc(var(--s-step) * 5) !important; }
|
|
105
|
-
.wmn50 { min-width: 50% !important; }
|
|
106
|
-
.wmn6 { min-width: calc(var(--s-step) * 6) !important; }
|
|
107
|
-
.wmn7 { min-width: calc(var(--s-step) * 7) !important; }
|
|
108
|
-
.wmn75 { min-width: 75% !important; }
|
|
109
|
-
.wmn8 { min-width: calc(var(--s-step) * 8) !important; }
|
|
110
|
-
.wmn9 { min-width: calc(var(--s-step) * 9) !important; }
|
|
111
|
-
.wmn10 { min-width: calc(var(--s-step) * 10) !important; }
|
|
112
|
-
.wmn11 { min-width: calc(var(--s-step) * 11) !important; }
|
|
113
|
-
.wmn12 { min-width: var(--s-full) !important; }
|
|
114
|
-
#stacks-internals #responsify('.wmn100', { min-width: 100% !important; });
|
|
115
|
-
#stacks-internals #responsify('.wmn-initial', { min-width: initial !important; });
|
|
116
|
-
|
|
117
|
-
// ============================================================================
|
|
118
|
-
// $ HEIGHT
|
|
119
|
-
// ----------------------------------------------------------------------------
|
|
120
|
-
// $$ PERCENTAGE AND VIEWPORT UNITS
|
|
121
|
-
.h0 { height: 0 !important; }
|
|
122
|
-
#stacks-internals #responsify('.h100', { height: 100% !important; });
|
|
123
|
-
#stacks-internals #responsify('.h-auto', { height: auto !important; });
|
|
124
|
-
#stacks-internals #responsify('.h-screen', { height: 100vh !important; });
|
|
125
|
-
|
|
126
|
-
// $$ STATIC
|
|
127
|
-
.hs0,
|
|
128
|
-
.h0 { height: 0 !important; }
|
|
129
|
-
.hs1 { height: var(--s-step) !important; }
|
|
130
|
-
.hs2 { height: calc(var(--s-step) * 2) !important; }
|
|
131
|
-
.hs3 { height: calc(var(--s-step) * 3) !important; }
|
|
132
|
-
.hs4 { height: calc(var(--s-step) * 4) !important; }
|
|
133
|
-
.hs5 { height: calc(var(--s-step) * 5) !important; }
|
|
134
|
-
.hs6 { height: calc(var(--s-step) * 6) !important; }
|
|
135
|
-
.hs7 { height: calc(var(--s-step) * 7) !important; }
|
|
136
|
-
.hs8 { height: calc(var(--s-step) * 8) !important; }
|
|
137
|
-
.hs9 { height: calc(var(--s-step) * 9) !important; }
|
|
138
|
-
.hs10 { height: calc(var(--s-step) * 10) !important; }
|
|
139
|
-
.hs11 { height: calc(var(--s-step) * 11) !important; }
|
|
140
|
-
.hs12 { height: var(--s-full) !important; }
|
|
141
|
-
|
|
142
|
-
// $$ SPACING UNITS
|
|
143
|
-
.h2 { height: var(--su-static2) !important; }
|
|
144
|
-
.h4 { height: var(--su-static4) !important; }
|
|
145
|
-
.h6 { height: var(--su-static6) !important; }
|
|
146
|
-
.h8 { height: var(--su-static8) !important; }
|
|
147
|
-
.h12 { height: var(--su-static12) !important; }
|
|
148
|
-
.h16 { height: var(--su-static16) !important; }
|
|
149
|
-
.h24 { height: var(--su-static24) !important; }
|
|
150
|
-
.h32 { height: var(--su-static32) !important; }
|
|
151
|
-
.h48 { height: var(--su-static48) !important; }
|
|
152
|
-
.h64 { height: var(--su-static64) !important; }
|
|
153
|
-
.h96 { height: var(--su-static96) !important; }
|
|
154
|
-
.h128 { height: var(--su-static128) !important; }
|
|
155
|
-
|
|
156
|
-
// ============================================================================
|
|
157
|
-
// $ MAX-HEIGHT
|
|
158
|
-
// ----------------------------------------------------------------------------
|
|
159
|
-
.hmx0 { max-height: 0 !important; }
|
|
160
|
-
.hmx1 { max-height: var(--s-step) !important; }
|
|
161
|
-
.hmx2 { max-height: calc(var(--s-step) * 2) !important; }
|
|
162
|
-
.hmx3 { max-height: calc(var(--s-step) * 3) !important; }
|
|
163
|
-
.hmx4 { max-height: calc(var(--s-step) * 4) !important; }
|
|
164
|
-
.hmx5 { max-height: calc(var(--s-step) * 5) !important; }
|
|
165
|
-
.hmx6 { max-height: calc(var(--s-step) * 6) !important; }
|
|
166
|
-
.hmx7 { max-height: calc(var(--s-step) * 7) !important; }
|
|
167
|
-
.hmx8 { max-height: calc(var(--s-step) * 8) !important; }
|
|
168
|
-
.hmx9 { max-height: calc(var(--s-step) * 9) !important; }
|
|
169
|
-
.hmx10 { max-height: calc(var(--s-step) * 10) !important; }
|
|
170
|
-
.hmx11 { max-height: calc(var(--s-step) * 11) !important; }
|
|
171
|
-
.hmx12 { max-height: var(--s-full) !important; }
|
|
172
|
-
#stacks-internals #responsify('.hmx100', { max-height: 100% !important; });
|
|
173
|
-
#stacks-internals #responsify('.hmx-initial', { max-height: initial !important; });
|
|
174
|
-
#stacks-internals #responsify('.hmx-screen', { max-height: 100vh !important; });
|
|
175
|
-
|
|
176
|
-
// ============================================================================
|
|
177
|
-
// $ MIN-HEIGHT
|
|
178
|
-
// ----------------------------------------------------------------------------
|
|
179
|
-
.hmn0 { min-height: 0 !important; }
|
|
180
|
-
.hmn1 { min-height: var(--s-step) !important; }
|
|
181
|
-
.hmn2 { min-height: calc(var(--s-step) * 2) !important; }
|
|
182
|
-
.hmn3 { min-height: calc(var(--s-step) * 3) !important; }
|
|
183
|
-
.hmn4 { min-height: calc(var(--s-step) * 4) !important; }
|
|
184
|
-
.hmn5 { min-height: calc(var(--s-step) * 5) !important; }
|
|
185
|
-
.hmn6 { min-height: calc(var(--s-step) * 6) !important; }
|
|
186
|
-
.hmn7 { min-height: calc(var(--s-step) * 7) !important; }
|
|
187
|
-
.hmn8 { min-height: calc(var(--s-step) * 8) !important; }
|
|
188
|
-
.hmn9 { min-height: calc(var(--s-step) * 9) !important; }
|
|
189
|
-
.hmn10 { min-height: calc(var(--s-step) * 10) !important; }
|
|
190
|
-
.hmn11 { min-height: calc(var(--s-step) * 11) !important; }
|
|
191
|
-
.hmn12 { min-height: var(--s-full) !important; }
|
|
192
|
-
#stacks-internals #responsify('.hmn100', { min-height: 100% !important; });
|
|
193
|
-
#stacks-internals #responsify('.hmn-initial', { min-height: initial !important; });
|
|
194
|
-
#stacks-internals #responsify('.hmn-screen', { min-height: 100vh !important; });
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.s-award-bling {
|
|
2
|
-
--_ab-before-bg: unset;
|
|
3
|
-
|
|
4
|
-
// VARIANTS
|
|
5
|
-
// TODO SHINE expect a conflict with the award-bling updates. Prefer the changes in https://github.com/StackExchange/Stacks/pull/2013.
|
|
6
|
-
&&__gold {
|
|
7
|
-
--_ab-before-bg: var(--yellow-300);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&&__silver {
|
|
11
|
-
--_ab-before-bg: var(--blue-300);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&&__bronze {
|
|
15
|
-
--_ab-before-bg: var(--orange-300);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// CHILD ELEMENTS
|
|
19
|
-
&:before {
|
|
20
|
-
background-color: var(--_ab-before-bg);
|
|
21
|
-
|
|
22
|
-
border-radius: 100%;
|
|
23
|
-
content: "";
|
|
24
|
-
margin-right: var(--su4);
|
|
25
|
-
height: var(--su8);
|
|
26
|
-
width: var(--su8);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
align-items: center;
|
|
30
|
-
color: inherit;
|
|
31
|
-
display: flex;
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.s-check-control { // TODO would _love_ to use .s-check instead, with no class on the input itself
|
|
2
|
-
--_cc-ai: center;
|
|
3
|
-
|
|
4
|
-
// CONTEXTUAL STYLES
|
|
5
|
-
.s-check-group & {
|
|
6
|
-
--_cc-ai: flex-start; // manually align the checkboxes and radios to the top of the group
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// CHILD ELEMENTS
|
|
10
|
-
.s-label {
|
|
11
|
-
font-weight: normal;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
align-items: var(--_cc-ai);
|
|
15
|
-
display: flex;
|
|
16
|
-
gap: var(--su8);
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.s-check-group {
|
|
2
|
-
--_cg-fd: column;
|
|
3
|
-
|
|
4
|
-
// MODIFIERS
|
|
5
|
-
&&__horizontal {
|
|
6
|
-
--_cg-fd: row;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// CHILD ELEMENTS
|
|
10
|
-
// TODO HACK? <legend> isn't respecting gap...
|
|
11
|
-
legend.s-label {
|
|
12
|
-
margin-bottom: var(--su8);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
flex-direction: var(--_cg-fd);
|
|
16
|
-
|
|
17
|
-
display: flex;
|
|
18
|
-
gap: var(--su8);
|
|
19
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
.s-skeleton {
|
|
2
|
-
// BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES
|
|
3
|
-
// TODO verify colors with design
|
|
4
|
-
--_sk-bg-1: var(--black-400);
|
|
5
|
-
--_sk-bg-2: var(--black-350);
|
|
6
|
-
--_sk-bg-3: var(--black-300);
|
|
7
|
-
--_sk-o: 0.25;
|
|
8
|
-
|
|
9
|
-
// CONTEXTUAL STYLES
|
|
10
|
-
.highcontrast-mode({
|
|
11
|
-
--_sk-o: 0.4;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
@keyframes flow {
|
|
15
|
-
0% {
|
|
16
|
-
background-position: 400% 50%;
|
|
17
|
-
}
|
|
18
|
-
100% {
|
|
19
|
-
background-position: 0% 50%;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// VARIANTS
|
|
24
|
-
&&__ai {
|
|
25
|
-
--_sk-bg-1: #ac76f0;
|
|
26
|
-
--_sk-bg-2: #297fff;
|
|
27
|
-
--_sk-bg-3: #6abcf8;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&,
|
|
31
|
-
&:after,
|
|
32
|
-
&:before {
|
|
33
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
34
|
-
animation: flow 8s linear infinite;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
background-image: linear-gradient(
|
|
38
|
-
to right,
|
|
39
|
-
var(--_sk-bg-1) 8%,
|
|
40
|
-
var(--_sk-bg-2) 16%,
|
|
41
|
-
var(--_sk-bg-3) 25%,
|
|
42
|
-
var(--_sk-bg-1) 42%,
|
|
43
|
-
var(--_sk-bg-2) 58%,
|
|
44
|
-
var(--_sk-bg-3) 75%,
|
|
45
|
-
var(--_sk-bg-1) 83%
|
|
46
|
-
);
|
|
47
|
-
background-size: 400% 100%;
|
|
48
|
-
border-radius: var(--br-md);
|
|
49
|
-
display: block;
|
|
50
|
-
height: var(--su16);
|
|
51
|
-
position: relative;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&:after,
|
|
55
|
-
&:before {
|
|
56
|
-
content: '';
|
|
57
|
-
position: relative;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&:after {
|
|
61
|
-
top: calc(var(--su4));
|
|
62
|
-
width: calc(2/3 * 100%);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&:before {
|
|
66
|
-
top: calc(var(--su32) + var(--su8));
|
|
67
|
-
width: calc(1/3 * 100%);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
margin-bottom: var(--su48);
|
|
71
|
-
opacity: var(--_sk-o);
|
|
72
|
-
width: 100%;
|
|
73
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate base and responsive atomic spacing classes.
|
|
3
|
-
*
|
|
4
|
-
* Usage example:
|
|
5
|
-
* .generate-spacing('.m', margin, true);
|
|
6
|
-
* .generate-spacing('.ml', margin-left, true, percent);
|
|
7
|
-
* .generate-spacing('.mx'; margin-left, margin-right; true);
|
|
8
|
-
* .generate-spacing('.pr', padding-right);
|
|
9
|
-
*
|
|
10
|
-
* @prefix - (required) What prefix to generate (e.g. `.m`, `.pr`, etc).
|
|
11
|
-
* @properties - (required) What CSS properties to generate (e.g. `margin`, `margin-right, margin-left`, etc).
|
|
12
|
-
* @includeNegative: bool - Boolean to include generation of negative value classes.
|
|
13
|
-
* @type: px | percent - What set of value to generate.
|
|
14
|
-
*/
|
|
15
|
-
.generate-spacing(@prefix, @properties, @includeNegative: false, @type: px) {
|
|
16
|
-
& when (@type = px) {
|
|
17
|
-
#stacks-internals #build-classes(
|
|
18
|
-
responsive,
|
|
19
|
-
@prefix,
|
|
20
|
-
{ .template(@value) {
|
|
21
|
-
each(@properties, #(@prop) {
|
|
22
|
-
@{prop}: var(~"--su@{value}") !important;
|
|
23
|
-
})
|
|
24
|
-
} },
|
|
25
|
-
0 1 2 4 6 8 12 16 24 32 48 64 96 128
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
& when (@includeNegative = true) {
|
|
29
|
-
#stacks-internals #build-classes(
|
|
30
|
-
responsive,
|
|
31
|
-
~"@{prefix}n",
|
|
32
|
-
{ .template(@value) {
|
|
33
|
-
each(@properties, #(@prop) {
|
|
34
|
-
@{prop}: calc(var(~"--su@{value}") * -1) !important;
|
|
35
|
-
})
|
|
36
|
-
} },
|
|
37
|
-
1 2 4 6 8 12 16 24 32 48 64 96 128
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
& when (@type = percent) {
|
|
43
|
-
#stacks-internals #build-classes(
|
|
44
|
-
responsive,
|
|
45
|
-
@prefix,
|
|
46
|
-
{ .template(@value) {
|
|
47
|
-
each(@properties, #(@prop) {
|
|
48
|
-
@{prop}: @value !important;
|
|
49
|
-
})
|
|
50
|
-
} },
|
|
51
|
-
50% 100%
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
& when (@includeNegative = true) {
|
|
55
|
-
#stacks-internals #build-classes(
|
|
56
|
-
responsive,
|
|
57
|
-
~"@{prefix}n",
|
|
58
|
-
{ .template(@value) {
|
|
59
|
-
each(@properties, #(@prop) {
|
|
60
|
-
@{prop}: -@value !important;
|
|
61
|
-
})
|
|
62
|
-
} },
|
|
63
|
-
50% 100%
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|