maverick-wave 4.4.1 → 4.5.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.
@@ -1,5 +1,51 @@
1
1
  @use '../abstracts' as *;
2
2
 
3
+ // One scrollbar look for every scrollable list. Was copy-pasted per variant
4
+ // before, which is how the checkbox list ended up with track and thumb in the
5
+ // same color - an invisible scrollbar.
6
+ @mixin _list-scrollbar {
7
+ scrollbar-gutter: stable; // Prevent layout shift
8
+
9
+ &::-webkit-scrollbar {
10
+ width: 7px;
11
+ }
12
+
13
+ &::-webkit-scrollbar-track {
14
+ background: var(--mw-primary-background);
15
+ border-radius: 3px;
16
+ }
17
+
18
+ &::-webkit-scrollbar-thumb {
19
+ background: var(--mw-text-muted-color);
20
+ border-radius: 3px;
21
+
22
+ &:hover {
23
+ background: var(--mw-primary-color);
24
+ }
25
+ }
26
+
27
+ // Modern Firefox scrollbar - needs both thumb and track, a single value
28
+ // makes the whole declaration invalid
29
+ scrollbar-width: thin;
30
+ scrollbar-color: var(--mw-text-muted-color) var(--mw-gray-background);
31
+ }
32
+
33
+ // Checkbox box and checkmark sizes - shape-drawing values, so px instead of
34
+ // spacing() keys. The checkmark has to scale with the box: compact used to be
35
+ // an 8px box (4px of usable space inside the 2px border) holding a 5.6px
36
+ // checkmark, so the mark broke out of its own box.
37
+ $_checkbox-box-compact: 12px;
38
+ $_checkbox-box-default: 14px;
39
+ $_checkbox-box-large: 16px;
40
+ $_check-compact-w: 5px;
41
+ $_check-compact-h: 3px;
42
+ $_check-default-w: 6px;
43
+ $_check-default-h: 3px;
44
+ $_check-large-w: 7px;
45
+ $_check-large-h: 4px;
46
+ // Nudges the box down onto the first text line when a header is present
47
+ $_checkbox-box-offset: 3px;
48
+
3
49
  // Base list styles
4
50
  .mw-list {
5
51
  margin: spacing('4') spacing('0');
@@ -82,15 +128,18 @@
82
128
 
83
129
  // Dot lists
84
130
  .mw-list-dot {
85
- padding-left: spacing('3');
86
- list-style: disc inside;
131
+ // outside keeps a wrapping line flush with the text instead of letting it
132
+ // run back underneath the bullet - the padding makes room for the marker
133
+ padding-left: spacing('6');
134
+ list-style: disc outside;
87
135
 
88
136
  li {
89
137
  padding-left: spacing('1');
90
138
  margin-bottom: spacing('1');
91
139
 
140
+ // ::marker only takes color, content and font properties - positioning
141
+ // it has no effect
92
142
  &::marker {
93
- left: spacing('0');
94
143
  color: var(--mw-primary-text-color);
95
144
  }
96
145
  }
@@ -102,14 +151,18 @@
102
151
  padding-left: spacing('3');
103
152
 
104
153
  li {
105
- padding-left: spacing('1');
154
+ position: relative;
155
+ padding-left: spacing('6');
106
156
  margin-bottom: spacing('1');
107
- }
108
157
 
109
- li::before {
110
- content: '✓';
111
- color: var(--mw-primary-text-color);
112
- padding-right: spacing('4');
158
+ // Taken out of the flow so a wrapping line keeps its indent instead of
159
+ // running back underneath the checkmark
160
+ &::before {
161
+ content: '';
162
+ position: absolute;
163
+ left: 0;
164
+ color: var(--mw-primary-text-color);
165
+ }
113
166
  }
114
167
  }
115
168
 
@@ -162,7 +215,10 @@
162
215
  padding: spacing('3');
163
216
  background: var(--mw-card-background);
164
217
  border: 1px solid transparent;
165
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
218
+ transition:
219
+ background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
220
+ border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
221
+ transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
166
222
  overflow: hidden;
167
223
 
168
224
  &::before {
@@ -176,11 +232,13 @@
176
232
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
177
233
  }
178
234
 
235
+ // The card carries its own background and radius, so moving the whole
236
+ // thing reads the same as growing the padding did - and runs on the
237
+ // compositor instead of relaying out the item on every hover
179
238
  &:hover {
180
- padding-left: spacing('4');
181
239
  background: var(--mw-primary-background-hover);
182
240
  border-color: var(--mw-primary-text-color);
183
- transform: translateX(4px);
241
+ transform: translateX(8px);
184
242
 
185
243
  &::before {
186
244
  width: 4px;
@@ -189,10 +247,8 @@
189
247
  }
190
248
  }
191
249
 
192
- // Secondary variant
250
+ // Secondary variant - additive, sits alongside mw-item-list-slide
193
251
  .mw-item-list-slide-secondary {
194
- @extend .mw-item-list-slide;
195
-
196
252
  > * {
197
253
  &::before {
198
254
  background: var(--mw-secondary-text-color);
@@ -212,13 +268,29 @@
212
268
  border: 1px solid var(--mw-border);
213
269
  border-radius: radius('md');
214
270
  overflow: hidden;
271
+ background: var(--mw-card-background);
215
272
 
216
273
  > * {
217
274
  padding: spacing('3');
218
275
  border-bottom: 1px solid var(--mw-border);
219
- transition: all 0.2s ease;
276
+ transition:
277
+ background 0.2s ease,
278
+ padding-left 0.2s ease;
220
279
  position: relative;
221
280
 
281
+ // Always present at zero width so it can grow on hover - creating it
282
+ // inside :hover means it snaps in with no transition
283
+ &::before {
284
+ content: '';
285
+ position: absolute;
286
+ left: 0;
287
+ top: 0;
288
+ bottom: 0;
289
+ width: 0;
290
+ background: var(--mw-primary-text-color);
291
+ transition: width 0.2s ease;
292
+ }
293
+
222
294
  &:last-child {
223
295
  border-bottom: none;
224
296
  }
@@ -228,13 +300,7 @@
228
300
  padding-left: spacing('4');
229
301
 
230
302
  &::before {
231
- content: '';
232
- position: absolute;
233
- left: 0;
234
- top: 0;
235
- bottom: 0;
236
303
  width: 3px;
237
- background: var(--mw-primary-text-color);
238
304
  }
239
305
  }
240
306
 
@@ -246,18 +312,21 @@
246
312
  padding-left: spacing('4');
247
313
 
248
314
  &::before {
249
- display: none;
315
+ width: 0;
250
316
  }
251
317
  }
252
318
  }
253
319
  }
254
320
 
255
- // Nested compact lists styling
321
+ // Nested compact lists styling - only the left rule, the full border comes
322
+ // from the outer rule and would frame the nested list a second time
256
323
  .mw-item-list-compact {
257
324
  margin-top: spacing('2');
258
325
  margin-left: spacing('2');
326
+ border: none;
259
327
  border-left: 2px solid var(--mw-border);
260
328
  border-radius: 0;
329
+ background: transparent;
261
330
 
262
331
  > * {
263
332
  padding: spacing('2');
@@ -285,7 +354,11 @@
285
354
  > * {
286
355
  padding: spacing('4');
287
356
  border-bottom: 1px solid var(--mw-border);
288
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
357
+ transition:
358
+ background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
359
+ padding-left 0.2s cubic-bezier(0.4, 0, 0.2, 1),
360
+ color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
361
+ transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
289
362
  cursor: pointer;
290
363
  display: flex;
291
364
  align-items: center;
@@ -317,37 +390,14 @@
317
390
  border: 1px solid var(--mw-border);
318
391
  border-radius: radius('md');
319
392
  background: var(--mw-card-background);
320
- scrollbar-gutter: stable; // Prevent layout shift
321
-
322
- // Custom scrollbar styling
323
- &::-webkit-scrollbar {
324
- width: 7px;
325
- }
326
-
327
- &::-webkit-scrollbar-track {
328
- background: var(--mw-primary-background);
329
- border-radius: 3px;
330
- }
331
-
332
- &::-webkit-scrollbar-thumb {
333
- background: var(--mw-text-muted-color);
334
- border-radius: 3px;
335
- opacity: 0.6;
336
-
337
- &:hover {
338
- background: var(--mw-primary-color);
339
- opacity: 1;
340
- }
341
- }
342
-
343
- // Modern Firefox scrollbar
344
- scrollbar-width: thin;
345
- scrollbar-color: var(--mw-text-muted-color) var(--mw-gray-background);
393
+ @include _list-scrollbar;
346
394
 
347
395
  > * {
348
396
  padding: spacing('3');
349
397
  border-bottom: 1px solid var(--mw-border);
350
- transition: all 0.2s ease;
398
+ transition:
399
+ background 0.2s ease,
400
+ color 0.2s ease;
351
401
 
352
402
  &:last-child {
353
403
  border-bottom: none;
@@ -365,19 +415,18 @@
365
415
  }
366
416
  }
367
417
 
368
- // Height variants
418
+ // Height modifiers - additive, put them alongside mw-item-list-scroll.
419
+ // Extending duplicated the whole scroll block three times over for what is
420
+ // one declaration each.
369
421
  .mw-item-list-scroll-sm {
370
- @extend .mw-item-list-scroll;
371
422
  max-height: 200px;
372
423
  }
373
424
 
374
425
  .mw-item-list-scroll-lg {
375
- @extend .mw-item-list-scroll;
376
426
  max-height: 400px;
377
427
  }
378
428
 
379
429
  .mw-item-list-scroll-xl {
380
- @extend .mw-item-list-scroll;
381
430
  max-height: 500px;
382
431
  }
383
432
 
@@ -397,7 +446,11 @@
397
446
  border-bottom: 1px solid var(--mw-border);
398
447
  border-left: 3px solid transparent;
399
448
  cursor: pointer;
400
- transition: all 0.2s ease;
449
+ transition:
450
+ background 0.2s ease,
451
+ color 0.2s ease,
452
+ transform 0.2s ease,
453
+ border-left-color 0.2s ease;
401
454
  user-select: none;
402
455
 
403
456
  &:last-child {
@@ -414,59 +467,31 @@
414
467
  transform: scale(0.98);
415
468
  }
416
469
 
470
+ // Only the deltas to the .mw-checkbox in form-elements. The hidden input,
471
+ // the box chrome and the checked, focus-visible, disabled and color states
472
+ // all come from there - copying them here used to shadow disabled and the
473
+ // size variants, because the nesting gave the copy a higher specificity.
417
474
  .mw-checkbox {
418
475
  display: flex;
419
- align-items: center;
420
476
  gap: spacing('3');
421
477
  flex: 1;
422
478
 
423
- // Hide native checkbox
424
- input[type='checkbox'] {
425
- position: absolute;
426
- opacity: 0;
427
- width: 0;
428
- height: 0;
429
- margin: spacing('0');
430
- }
431
-
432
- // Visual checkbox (the label)
479
+ // A list checkbox is smaller than a standalone one. Size is a list
480
+ // concern here - the -compact and -large list modifiers drive it, not
481
+ // mw-checkbox-sm/-lg, which sit on the wrong element to reach this.
433
482
  .mw-checkbox-box {
434
- position: relative;
435
- flex-shrink: 0;
436
- width: 14px;
437
- height: 14px;
438
- border: 2px solid var(--mw-border);
439
- border-radius: radius('sm');
440
- background: var(--mw-form-elements-background);
441
- transition: var(--mw-transition);
442
- margin-top: 3px;
443
- cursor: pointer;
444
- display: block;
445
-
446
- &::after {
447
- content: '';
448
- position: absolute;
449
- top: 50%;
450
- left: 50%;
451
- width: spacing('2');
452
- height: spacing('1');
453
- border-left: 2px solid var(--mw-primary-color);
454
- border-bottom: 2px solid var(--mw-primary-color);
455
- transform: translate(-50%, -60%) rotate(-45deg) scale(0);
456
- transform-origin: center;
457
- transition: var(--mw-transition);
458
- }
459
- }
460
-
461
- // Checked state
462
- input[type='checkbox']:checked + .mw-checkbox-box {
463
- border-color: var(--mw-primary-color);
483
+ width: $_checkbox-box-default;
484
+ height: $_checkbox-box-default;
485
+ margin-top: $_checkbox-box-offset;
464
486
 
465
487
  &::after {
466
- transform: translate(-50%, -60%) rotate(-45deg) scale(1);
488
+ width: $_check-default-w;
489
+ height: $_check-default-h;
467
490
  }
468
491
  }
469
492
 
493
+ // Header plus description stacked next to the box - a list-only
494
+ // extension, the form element carries a single label
470
495
  .mw-checkbox-content {
471
496
  display: flex;
472
497
  flex-direction: column;
@@ -529,9 +554,14 @@
529
554
  gap: spacing('1');
530
555
 
531
556
  .mw-checkbox-box {
532
- width: spacing('3');
533
- height: spacing('3');
557
+ width: $_checkbox-box-compact;
558
+ height: $_checkbox-box-compact;
534
559
  margin-top: spacing('1');
560
+
561
+ &::after {
562
+ width: $_check-compact-w;
563
+ height: $_check-compact-h;
564
+ }
535
565
  }
536
566
 
537
567
  .mw-checkbox-content {
@@ -570,9 +600,14 @@
570
600
  gap: spacing('3');
571
601
 
572
602
  .mw-checkbox-box {
573
- width: spacing('5');
574
- height: spacing('5');
603
+ width: $_checkbox-box-large;
604
+ height: $_checkbox-box-large;
575
605
  margin-top: spacing('1');
606
+
607
+ &::after {
608
+ width: $_check-large-w;
609
+ height: $_check-large-h;
610
+ }
576
611
  }
577
612
 
578
613
  .mw-checkbox-content {
@@ -603,10 +638,9 @@
603
638
  }
604
639
  }
605
640
 
606
- // Color variants for checkbox lists
641
+ // Color variants for checkbox lists - additive, sits alongside
642
+ // mw-item-list-checkbox
607
643
  .mw-item-list-checkbox-secondary {
608
- @extend .mw-item-list-checkbox;
609
-
610
644
  > * {
611
645
  &:hover {
612
646
  background: var(--mw-secondary-background-hover);
@@ -629,29 +663,5 @@
629
663
  @extend .mw-item-list-checkbox;
630
664
  max-height: 300px;
631
665
  overflow-y: auto;
632
- scrollbar-gutter: stable;
633
-
634
- // Same scrollbar styling as scroll lists
635
- &::-webkit-scrollbar {
636
- width: 6px;
637
- }
638
-
639
- &::-webkit-scrollbar-track {
640
- background: var(--mw-text-muted-color);
641
- border-radius: 3px;
642
- }
643
-
644
- &::-webkit-scrollbar-thumb {
645
- background: var(--mw-text-muted-color);
646
- border-radius: 3px;
647
- opacity: 0.6;
648
-
649
- &:hover {
650
- background: var(--mw-primary-color);
651
- opacity: 1;
652
- }
653
- }
654
-
655
- scrollbar-width: thin;
656
- scrollbar-color: var(--mw-text-muted-color);
666
+ @include _list-scrollbar;
657
667
  }