vanilla-framework 4.19.0 → 4.20.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.
package/package.json
CHANGED
|
@@ -134,6 +134,12 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
%vf-list-item-with-divisor-common-properties {
|
|
138
|
+
margin: 0;
|
|
139
|
+
padding-bottom: $sph--large;
|
|
140
|
+
padding-top: $sph--small;
|
|
141
|
+
}
|
|
142
|
+
|
|
137
143
|
%vf-list-item-bullet {
|
|
138
144
|
&::before {
|
|
139
145
|
color: $colors--theme--text-default;
|
|
@@ -149,6 +155,7 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
149
155
|
position: relative;
|
|
150
156
|
|
|
151
157
|
> .p-list--divided,
|
|
158
|
+
> .p-list--horizontal-section,
|
|
152
159
|
> .p-list {
|
|
153
160
|
margin-left: 0;
|
|
154
161
|
}
|
|
@@ -161,10 +168,9 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
161
168
|
}
|
|
162
169
|
|
|
163
170
|
@mixin vf-list-item-divided {
|
|
171
|
+
@extend %vf-list-item-with-divisor-common-properties;
|
|
172
|
+
|
|
164
173
|
box-shadow: inset 0px 1px 0px 0px $colors--theme--border-low-contrast;
|
|
165
|
-
margin: 0;
|
|
166
|
-
padding-bottom: $sph--large;
|
|
167
|
-
padding-top: $sph--small;
|
|
168
174
|
|
|
169
175
|
&:first-child {
|
|
170
176
|
box-shadow: none;
|
|
@@ -175,6 +181,21 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
175
181
|
}
|
|
176
182
|
}
|
|
177
183
|
|
|
184
|
+
@mixin vf-list-item-horizontal-section {
|
|
185
|
+
@extend %vf-list-item-with-divisor-common-properties;
|
|
186
|
+
|
|
187
|
+
// Allows list item pseudo-elements to be absolutely positioned relative to the list item
|
|
188
|
+
position: relative;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Offset a list item icon (tick or cross) away from the divisor above it
|
|
192
|
+
@mixin vf-list-item-icon-divisor-offset {
|
|
193
|
+
&.is-ticked::before,
|
|
194
|
+
&.is-crossed::before {
|
|
195
|
+
top: $spv--medium;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
178
199
|
// Mixin for inline list items
|
|
179
200
|
@mixin vf-inline-list-item {
|
|
180
201
|
display: inline;
|
|
@@ -199,6 +220,87 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
199
220
|
}
|
|
200
221
|
}
|
|
201
222
|
|
|
223
|
+
// Sets horizontal list section grid column count and makes list item borders span the full grid width.
|
|
224
|
+
// $columns: Number of columns that the list items should be divided into.
|
|
225
|
+
// $skip-cols: Number of columns at the start of each row to skip
|
|
226
|
+
@mixin list-horizontal-section-row-width($columns, $skip-cols: 0) {
|
|
227
|
+
--columns: #{$columns + $skip-cols};
|
|
228
|
+
// List item borders span full grid width, not list item width.
|
|
229
|
+
// Multiply 100% width by the number of columns to create a border that spans the full grid width.
|
|
230
|
+
.p-list__item:nth-child(#{$columns}n + 1)::after {
|
|
231
|
+
background: $colors--theme--border-low-contrast;
|
|
232
|
+
content: '';
|
|
233
|
+
height: 1px;
|
|
234
|
+
left: 0;
|
|
235
|
+
position: absolute;
|
|
236
|
+
top: 0;
|
|
237
|
+
// 100% * columns = total width of all list item columns in a row
|
|
238
|
+
// (gutter width) * (columns - 1) = total width of all gutters in a row
|
|
239
|
+
// width = (width of list items) + (width of gutters)
|
|
240
|
+
width: calc(100% * #{$columns} + #{$columns - 1} * map-get($grid-gutter-widths, default));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@if $skip-cols > 0 {
|
|
244
|
+
@for $i from 1 through $skip-cols {
|
|
245
|
+
.p-list__item:nth-child(#{$columns}n + #{$i}) {
|
|
246
|
+
grid-column-start: #{($i + 1)};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@mixin vf-p-list-horizontal-section {
|
|
253
|
+
$horizontal-list-section-medium-content-width: 66ch;
|
|
254
|
+
$horizontal-list-section-large-content-width: 100ch;
|
|
255
|
+
|
|
256
|
+
.p-list--horizontal-section-wrapper {
|
|
257
|
+
container-type: inline-size;
|
|
258
|
+
|
|
259
|
+
.p-list--horizontal-section {
|
|
260
|
+
@extend %vf-list;
|
|
261
|
+
@extend %fixed-width-container;
|
|
262
|
+
|
|
263
|
+
display: grid;
|
|
264
|
+
|
|
265
|
+
@container (width >= #{$horizontal-list-section-medium-content-width}) {
|
|
266
|
+
grid-gap: 0 map-get($grid-gutter-widths, default);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@container (width < #{$horizontal-list-section-medium-content-width}) {
|
|
270
|
+
@include list-horizontal-section-row-width($columns: 1);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@container (#{$horizontal-list-section-medium-content-width} <= width < #{$horizontal-list-section-large-content-width}) {
|
|
274
|
+
@include list-horizontal-section-row-width($columns: 2);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// We cannot override the default behavior with modifiers, as each container query creates styles for different pseudo-element indices
|
|
278
|
+
// So, we need to negate variant selectors before applying any styling that does not apply to all variants
|
|
279
|
+
&:not(.is-25-75) {
|
|
280
|
+
@container (width >= #{$horizontal-list-section-large-content-width}) {
|
|
281
|
+
@include list-horizontal-section-row-width($columns: 4);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// --columns is set in the container queries above
|
|
286
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
|
287
|
+
|
|
288
|
+
.p-list__item {
|
|
289
|
+
@extend %vf-list-item;
|
|
290
|
+
@include vf-list-item-icon-divisor-offset;
|
|
291
|
+
@include vf-list-item-horizontal-section;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.p-list--horizontal-section.is-25-75 {
|
|
296
|
+
// skip first column on large
|
|
297
|
+
@container (width >= #{$horizontal-list-section-large-content-width}) {
|
|
298
|
+
@include list-horizontal-section-row-width($columns: 3, $skip-cols: 1);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
202
304
|
// A list with separators between items
|
|
203
305
|
@mixin vf-p-list-divided {
|
|
204
306
|
.p-list--divided {
|
|
@@ -207,11 +309,7 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
207
309
|
.p-list__item {
|
|
208
310
|
@extend %vf-list-item;
|
|
209
311
|
@include vf-list-item-divided;
|
|
210
|
-
|
|
211
|
-
&.is-ticked::before,
|
|
212
|
-
&.is-crossed::before {
|
|
213
|
-
top: $spv--medium;
|
|
214
|
-
}
|
|
312
|
+
@include vf-list-item-icon-divisor-offset;
|
|
215
313
|
}
|
|
216
314
|
|
|
217
315
|
& & {
|
|
@@ -226,7 +324,8 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
226
324
|
}
|
|
227
325
|
|
|
228
326
|
// stylelint-disable selector-max-type -- we want to target ordered lists
|
|
229
|
-
ol.p-list--divided
|
|
327
|
+
ol.p-list--divided,
|
|
328
|
+
ol.p-list--horizontal-section {
|
|
230
329
|
counter-reset: p-list-divided-counter;
|
|
231
330
|
list-style: none;
|
|
232
331
|
|
|
@@ -489,6 +588,7 @@ $list-step-bullet-margin: $sph--x-large;
|
|
|
489
588
|
@include vf-p-list-placeholders;
|
|
490
589
|
|
|
491
590
|
@include vf-p-list;
|
|
591
|
+
@include vf-p-list-horizontal-section;
|
|
492
592
|
@include vf-p-list-divided;
|
|
493
593
|
@include vf-p-list-item-state;
|
|
494
594
|
@include vf-p-inline-list;
|