maverick-wave 5.36.0 → 5.38.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.
@@ -8,6 +8,7 @@
8
8
  //
9
9
  // <html class="mw-occasion-snow"> static, CSS only
10
10
  // <html class="mw-occasion-snow mw-occasion-scroll"> arrives with the scroll
11
+ // <div class="mw-card mw-occasion-snow"> this card alone
11
12
  //
12
13
  // The intro overlay and the particles that drift with the scroll are the two
13
14
  // parts that need the script; everything they show is drawn here.
@@ -391,16 +392,6 @@ $_effects: (
391
392
  anniversary
392
393
  );
393
394
 
394
- // Cards, panels and testimonials, unless inside one another - a nested card
395
- // would stack a second garland into the first - plus whatever opts in
396
- $_surfaces: '.mw-card, .mw-panel, .mw-testimonial';
397
- $_surface: ':is(#{$_surfaces}):not(:is(#{$_surfaces}) *, .mw-occasion-skip)';
398
- $_host: '#{$_surface}, .mw-occasion-spot';
399
-
400
- @function _on($effect, $mode: '') {
401
- @return ':root#{$mode}.mw-occasion-#{$effect} :is(#{$_host})';
402
- }
403
-
404
395
  @function _list-classes() {
405
396
  $classes: ();
406
397
 
@@ -411,6 +402,30 @@ $_host: '#{$_surface}, .mw-occasion-spot';
411
402
  @return $classes;
412
403
  }
413
404
 
405
+ $_effect-classes: _list-classes();
406
+
407
+ // Cards, panels and testimonials, unless inside one another - a nested card
408
+ // would stack a second garland into the first - plus whatever opts in. A
409
+ // surface with an effect class of its own shows that one and leaves the site's.
410
+ $_surfaces: '.mw-card, .mw-panel, .mw-testimonial';
411
+ $_carriers: '#{$_surfaces}, .mw-occasion-spot';
412
+ $_surface: ':is(#{$_surfaces}):not(:is(#{$_surfaces}) *, .mw-occasion-skip, #{$_effect-classes})';
413
+ $_host: '#{$_surface}, .mw-occasion-spot:not(#{$_effect-classes})';
414
+
415
+ // Every surface while the site wears the effect, and the one surface that
416
+ // carries it itself - a single card showing it off. $mode goes where the
417
+ // effect class sits, on the root or on that surface.
418
+ @function _on($effect, $mode: '', $then: '::before') {
419
+ @return ':root#{$mode}.mw-occasion-#{$effect} :is(#{$_host})#{$then}, ' +
420
+ '.mw-occasion-#{$effect}#{$mode}:is(#{$_carriers})#{$then}';
421
+ }
422
+
423
+ // The same without the spots, for what a surface draws on its own background
424
+ @function _surface-on($effect) {
425
+ @return ':root.mw-occasion-#{$effect} #{$_surface}, ' +
426
+ '.mw-occasion-#{$effect}:is(#{$_surfaces})';
427
+ }
428
+
414
429
  @function _scaled($value) {
415
430
  @return calc(#{$value} * var(--mw-occasion-scale));
416
431
  }
@@ -423,7 +438,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
423
438
  // So every piece sits top left, mirrored because the art is drawn for a right
424
439
  // corner. transform and not `scale`: the arrival animations own that one.
425
440
  @mixin _corner($effect, $top, $width, $height, $side: -4px) {
426
- #{_on($effect)}::before {
441
+ #{_on($effect)} {
427
442
  top: _scaled($top);
428
443
  left: _scaled($side);
429
444
  width: _scaled($width);
@@ -440,7 +455,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
440
455
  // surface's own width, which a viewport query cannot: a card in a three-column
441
456
  // grid is as narrow as a phone.
442
457
  @mixin _edge($effect, $top, $height, $left: 4px) {
443
- #{_on($effect)}::before {
458
+ #{_on($effect)} {
444
459
  top: $top;
445
460
  left: $left;
446
461
  width: min(
@@ -528,12 +543,13 @@ $_host: '#{$_surface}, .mw-occasion-spot';
528
543
  --mw-occasion-amount: 1;
529
544
  }
530
545
 
531
- :root.mw-occasion-sm {
546
+ // On the root for the site, on a surface for that one surface
547
+ .mw-occasion-sm {
532
548
  --mw-occasion-scale: 0.88;
533
549
  --mw-occasion-amount: 0.55;
534
550
  }
535
551
 
536
- :root.mw-occasion-lg {
552
+ .mw-occasion-lg {
537
553
  --mw-occasion-scale: 1.1;
538
554
  --mw-occasion-amount: 1.3;
539
555
  }
@@ -556,39 +572,42 @@ $_host: '#{$_surface}, .mw-occasion-spot';
556
572
  );
557
573
 
558
574
  @each $effect, $reach in $_reach {
559
- :root.mw-occasion-#{$effect} {
575
+ .mw-occasion-#{$effect} {
560
576
  --mw-occasion-reach: #{$reach};
561
577
  }
562
578
  }
563
579
 
564
- :root:is(#{_list-classes()}) {
565
- // Room above for what rises over the top edge - stacked in one column on a
566
- // phone, the piece would otherwise reach into the surface above
567
- #{$_surface} {
568
- margin-top: calc(6px + 30px * (var(--mw-occasion-scale) - 1));
569
- }
570
-
571
- // A panel clips for its rounded header, which rounds itself - the same
572
- // escape the dropdown uses, for as long as an occasion is on
573
- .mw-panel:not(:is(#{$_surfaces}) *, .mw-occasion-skip) {
574
- overflow: visible;
580
+ // Room above for what rises over the top edge - stacked in one column on a
581
+ // phone, the piece would otherwise reach into the surface above
582
+ :root:is(#{$_effect-classes}) #{$_surface},
583
+ :is(#{$_effect-classes}):is(#{$_surfaces}) {
584
+ margin-top: calc(6px + 30px * (var(--mw-occasion-scale) - 1));
585
+ }
575
586
 
576
- > :is(.mw-panel-header, .mw-panel-body):first-child {
577
- padding-top: max(
578
- #{spacing('4')},
579
- calc(var(--mw-occasion-reach) * var(--mw-occasion-scale))
580
- );
581
- }
582
- }
587
+ // A panel clips for its rounded header, which rounds itself - the same
588
+ // escape the dropdown uses, for as long as an occasion is on
589
+ :root:is(#{$_effect-classes})
590
+ .mw-panel:not(:is(#{$_surfaces}) *, .mw-occasion-skip),
591
+ .mw-panel:is(#{$_effect-classes}) {
592
+ overflow: visible;
583
593
 
584
- .mw-testimonial:not(:is(#{$_surfaces}) *, .mw-occasion-skip) {
594
+ > :is(.mw-panel-header, .mw-panel-body):first-child {
585
595
  padding-top: max(
586
- #{spacing('5')},
596
+ #{spacing('4')},
587
597
  calc(var(--mw-occasion-reach) * var(--mw-occasion-scale))
588
598
  );
589
599
  }
590
600
  }
591
601
 
602
+ :root:is(#{$_effect-classes})
603
+ .mw-testimonial:not(:is(#{$_surfaces}) *, .mw-occasion-skip),
604
+ .mw-testimonial:is(#{$_effect-classes}) {
605
+ padding-top: max(
606
+ #{spacing('5')},
607
+ calc(var(--mw-occasion-reach) * var(--mw-occasion-scale))
608
+ );
609
+ }
610
+
592
611
  :where(.mw-occasion-spot) {
593
612
  position: relative;
594
613
  }
@@ -596,7 +615,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
596
615
  // Shared by every effect. z-index 1 keeps the piece above the text and the
597
616
  // corner arc, and the card badge - also 1, but later - above the piece.
598
617
  @each $effect in $_effects {
599
- #{_on($effect)}::before {
618
+ #{_on($effect)} {
600
619
  content: '';
601
620
  position: absolute;
602
621
  z-index: 1;
@@ -634,7 +653,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
634
653
  transform-origin: 50% _deep(11px);
635
654
  }
636
655
 
637
- #{_on('snow')}:nth-child(even)::before {
656
+ #{_on('snow', $then: ':nth-child(even)::before')} {
638
657
  background-position:
639
658
  40% _deep(13px),
640
659
  76% _deep(13px),
@@ -644,11 +663,11 @@ $_host: '#{$_surface}, .mw-occasion-spot';
644
663
  0 0;
645
664
  }
646
665
 
647
- #{_on('snow', '.mw-occasion-sm')}::before {
666
+ #{_on('snow', '.mw-occasion-sm')} {
648
667
  background-size: _snow-sizes(1);
649
668
  }
650
669
 
651
- #{_on('snow', '.mw-occasion-lg')}::before {
670
+ #{_on('snow', '.mw-occasion-lg')} {
652
671
  background-size: _snow-sizes(3);
653
672
  }
654
673
 
@@ -672,16 +691,16 @@ $_host: '#{$_surface}, .mw-occasion-spot';
672
691
  }
673
692
 
674
693
  // Same baubles, shuffled - repeating the images would double their weight
675
- #{_on(christmas)}:nth-child(even)::before {
694
+ #{_on(christmas, $then: ':nth-child(even)::before')} {
676
695
  background-position: _bauble-positions(62% 34% 88% 0);
677
696
  }
678
697
 
679
- #{_on(christmas, '.mw-occasion-sm')}::before {
698
+ #{_on(christmas, '.mw-occasion-sm')} {
680
699
  background-size: _bauble-sizes(2);
681
700
  background-position: _bauble-positions(34% 74% 0 0);
682
701
  }
683
702
 
684
- #{_on(christmas, '.mw-occasion-lg')}::before {
703
+ #{_on(christmas, '.mw-occasion-lg')} {
685
704
  background-size: _bauble-sizes(4);
686
705
  background-position: _bauble-positions(18% 40% 62% 84%);
687
706
  }
@@ -706,7 +725,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
706
725
  background-image: $_sun;
707
726
  }
708
727
 
709
- :root.mw-occasion-summer #{$_surface} {
728
+ #{_surface-on(summer)} {
710
729
  background-image: radial-gradient(
711
730
  26rem 16rem at 0 0,
712
731
  rgb(255 214 90 / calc(0.13 * var(--mw-occasion-amount))),
@@ -724,7 +743,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
724
743
  background-image: $_ball;
725
744
  }
726
745
 
727
- :root.mw-occasion-football #{$_surface} {
746
+ #{_surface-on(football)} {
728
747
  background-image: linear-gradient(
729
748
  90deg,
730
749
  var(--mw-occasion-flag-1) 0 33.34%,
@@ -798,12 +817,13 @@ $_host: '#{$_surface}, .mw-occasion-spot';
798
817
  @media (prefers-reduced-motion: no-preference) {
799
818
  // Timed by the card's entry, which even the last card on a page completes;
800
819
  // 60vh keeps a tall card from arriving only at the top of the screen
801
- :root.mw-occasion-scroll :is(#{$_host}) {
820
+ :root.mw-occasion-scroll :is(#{$_host}),
821
+ .mw-occasion-scroll:is(#{$_effect-classes}):is(#{$_carriers}) {
802
822
  view-timeline: --mw-occasion-arrival;
803
823
  }
804
824
 
805
825
  @each $effect, $arrival in $_arrivals {
806
- #{_on($effect, '.mw-occasion-scroll')}::before {
826
+ #{_on($effect, '.mw-occasion-scroll')} {
807
827
  animation-name: mw-occasion-#{$arrival};
808
828
  animation-duration: auto;
809
829
  animation-timing-function: linear;
@@ -1590,7 +1610,7 @@ $_host: '#{$_surface}, .mw-occasion-spot';
1590
1610
  }
1591
1611
 
1592
1612
  @media print, (forced-colors: active) {
1593
- :is(#{$_host})::before,
1613
+ :is(#{$_carriers})::before,
1594
1614
  .mw-occasion-intro,
1595
1615
  .mw-occasion-drift {
1596
1616
  display: none;