maverick-wave 5.10.0 → 5.12.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
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "maverick-wave",
3
- "version": "5.10.0",
3
+ "version": "5.12.0",
4
4
  "config": {
5
- "version_short": "5.10"
5
+ "version_short": "5.12"
6
6
  },
7
7
  "description": "A lightweight, modern CSS framework for building responsive websites with elegance and speed.",
8
8
  "main": "src/js/main.js",
package/src/js/main.js CHANGED
@@ -555,8 +555,9 @@
555
555
  // ===== Scroll Reveal =====
556
556
 
557
557
  // The cards ride the browser's own view timeline where there is one
558
- // (_reveal.scss). Firefox has none, so there an observer stands in: hide what
559
- // is still below the fold, run the same keyframes when it arrives.
558
+ // (_reveal.scss). Older Safari and Firefox have none, so there an observer
559
+ // stands in: hide what is still below the fold, run the same keyframes when
560
+ // it arrives.
560
561
  function initReveals() {
561
562
  if (CSS.supports('animation-timeline', 'view()')) return;
562
563
  if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
@@ -207,7 +207,10 @@
207
207
  rounded.</small
208
208
  >
209
209
  </span>
210
- <select data-variant-prop="--mw-radius-scale">
210
+ <select
211
+ class="mw-select mw-select-sm"
212
+ data-variant-prop="--mw-radius-scale"
213
+ >
211
214
  <option value="0">Square</option>
212
215
  <option value="" selected>Default</option>
213
216
  <option value="1.7">Round</option>
@@ -222,7 +225,7 @@
222
225
  shape.</small
223
226
  >
224
227
  </span>
225
- <select data-variant-classes>
228
+ <select class="mw-select mw-select-sm" data-variant-classes>
226
229
  <option value="mw-btn-square">Square</option>
227
230
  <option value="" selected>Default</option>
228
231
  <option value="mw-btn-pill">Pill</option>
@@ -237,7 +240,7 @@
237
240
  their own treatment.</small
238
241
  >
239
242
  </span>
240
- <select data-variant-classes>
243
+ <select class="mw-select mw-select-sm" data-variant-classes>
241
244
  <option value="" selected>Default</option>
242
245
  <option value="mw-btn-glass">Glass</option>
243
246
  <option value="mw-btn-tactile">Tactile</option>
@@ -304,7 +307,7 @@
304
307
  the size it is - use Text size to scale everything together.</small
305
308
  >
306
309
  </span>
307
- <select data-variant-classes>
310
+ <select class="mw-select mw-select-sm" data-variant-classes>
308
311
  <option value="mw-density-compact">Compact</option>
309
312
  <option value="" selected>Default</option>
310
313
  <option value="mw-density-roomy">Roomy</option>
@@ -319,7 +322,10 @@
319
322
  heights move together.</small
320
323
  >
321
324
  </span>
322
- <select data-variant-prop="--mw-root-font-size">
325
+ <select
326
+ class="mw-select mw-select-sm"
327
+ data-variant-prop="--mw-root-font-size"
328
+ >
323
329
  <option value="93.75%">Compact</option>
324
330
  <option value="" selected>Default</option>
325
331
  <option value="106.25%">Large</option>
@@ -334,7 +340,10 @@
334
340
  screen.</small
335
341
  >
336
342
  </span>
337
- <select data-variant-prop="--mw-container-width">
343
+ <select
344
+ class="mw-select mw-select-sm"
345
+ data-variant-prop="--mw-container-width"
346
+ >
338
347
  <option value="min(800px, calc(100% - 2 * var(--mw-container-gutter)))">
339
348
  800
340
349
  </option>
@@ -372,7 +381,10 @@
372
381
  still win over this.</small
373
382
  >
374
383
  </span>
375
- <select data-variant-prop="--mw-motion-scale">
384
+ <select
385
+ class="mw-select mw-select-sm"
386
+ data-variant-prop="--mw-motion-scale"
387
+ >
376
388
  <option value="0.6">Brisk</option>
377
389
  <option value="" selected>Default</option>
378
390
  <option value="1.6">Relaxed</option>
@@ -434,7 +446,10 @@
434
446
  >How much air sits above and below each section of the page.</small
435
447
  >
436
448
  </span>
437
- <select data-variant-prop="--mw-section-padding-block">
449
+ <select
450
+ class="mw-select mw-select-sm"
451
+ data-variant-prop="--mw-section-padding-block"
452
+ >
438
453
  <option value="2rem">Compact</option>
439
454
  <option value="" selected>Default</option>
440
455
  <option value="5.5rem">Airy</option>
@@ -62,7 +62,26 @@
62
62
  Add <code>mw-parallax-rise</code> next to it and the picture lifts by
63
63
  <code>12vh</code> while the text stays where it is - a pinned block does not
64
64
  travel through the viewport, so that layer runs on the document's own scroll
65
- instead. <code>--mw-parallax-depth</code> is the dial, here as everywhere.
65
+ instead, over the first screen of it. That makes it a hero move: further down
66
+ the page those pixels are long gone and the picture holds still.
67
+ <code>--mw-parallax-depth</code> is the dial, here as everywhere. Several
68
+ pinned blocks on one page are fine, each takes over from the one before.
69
+ </p>
70
+
71
+ <h4 class="mw-text-medium mw-mb-2">
72
+ Slow - <code>mw-parallax-slow</code>, the block travels behind the page
73
+ </h4>
74
+ <p class="mw-text-muted mw-text-measure mw-mb-6">
75
+ The band before the components section on this page: it keeps its place in the
76
+ flow and moves at a quarter of your scrolling, so picture and text are still
77
+ going while the next section closes in from below. Pinning is the same move
78
+ with the tempo at zero.
79
+ <code>--mw-parallax-slow-travel</code> (<code>45vh</code>) is the dial and
80
+ reads against the block's own height - half the height is half speed, the full
81
+ height stands still. Going past it sends the block backwards. The dial belongs
82
+ on the element carrying the class, the height on the
83
+ <code>mw-parallax</code> block inside it: set on the inner block it never
84
+ reaches the animation and the tempo stays at the default.
66
85
  </p>
67
86
 
68
87
  <h4 class="mw-text-medium mw-mb-2">
@@ -348,6 +348,7 @@
348
348
  }
349
349
 
350
350
  &-content {
351
+ align-self: stretch;
351
352
  padding-left: spacing('3');
352
353
  }
353
354
  }
@@ -63,11 +63,11 @@
63
63
  }
64
64
  }
65
65
 
66
- // Firefox ships no scroll timelines, so there the script toggles these
67
- // classes instead (main.js) - the same two positions, triggered instead of
68
- // scrubbed. State and transition are separate because the script sets the
69
- // state a frame earlier: together they would send the bar sliding away in
70
- // front of the reader instead of having it gone already.
66
+ // Older Safari and Firefox ship no scroll timelines, so there the script
67
+ // toggles these classes instead (main.js) - the same two positions,
68
+ // triggered instead of scrubbed. State and transition are separate because
69
+ // the script sets the state a frame earlier: together they would send the
70
+ // bar sliding away in front of the reader instead of having it gone already.
71
71
  @media (prefers-reduced-motion: no-preference) {
72
72
  .mw-header-reveal.mw-header-away {
73
73
  top: calc(-1 * var(--mw-header-reveal-offset));
@@ -86,6 +86,35 @@
86
86
  --mw-parallax-pattern-depth: 4vh;
87
87
  }
88
88
 
89
+ // A third way to use the scroll, between the two above: the block keeps its
90
+ // place in the flow but travels slower than the page, so the section after it
91
+ // closes in from below while picture and text are still moving.
92
+ //
93
+ // `exit` and never `cover`: the block leaves a gap where it used to sit, and
94
+ // the exit phase is the one that starts once its top edge is already past the
95
+ // top of the screen - which is where that gap then stays.
96
+ //
97
+ // Travel over the block's own height is what sets the tempo: half the height
98
+ // is half speed, the full height stands still and is mw-parallax-sticky.
99
+ .mw-parallax-slow {
100
+ --mw-parallax-slow-travel: 45vh;
101
+
102
+ position: relative;
103
+ z-index: 0;
104
+ }
105
+
106
+ @supports (animation-timeline: view()) {
107
+ @media (prefers-reduced-motion: no-preference) {
108
+ .mw-parallax-slow {
109
+ animation-name: mw-parallax-band;
110
+ animation-timing-function: linear;
111
+ animation-fill-mode: both;
112
+ animation-timeline: view();
113
+ animation-range: exit 0% exit 100%;
114
+ }
115
+ }
116
+ }
117
+
89
118
  // A second layer on top of the first, added to the same media element. It
90
119
  // travels a third of the distance, and it is that difference between the two
91
120
  // that reads as depth - one layer alone only slides. What it carries is a
@@ -97,10 +126,15 @@
97
126
  background-image: var(--mw-parallax-pattern-image, none);
98
127
  }
99
128
 
100
- // Everything after it has to cover it, or the pinned picture shows through the
101
- // gaps. The z-index needs the weight of a class to beat the plain
102
- // `position: relative` those sections carry.
103
- .mw-parallax-sticky ~ * {
129
+ // Both variants above are overtaken rather than scrolled away, so everything
130
+ // after them has to cover them or the picture shows through the gaps. The
131
+ // z-index needs the weight of a class to beat the plain `position: relative`
132
+ // those sections carry.
133
+ //
134
+ // Except a pinned block: `position: relative` here and `sticky` above carry
135
+ // the same weight, and this rule is the later one - it would take the pinning
136
+ // away from every band after the first.
137
+ :is(.mw-parallax-sticky, .mw-parallax-slow) ~ *:not(.mw-parallax-sticky) {
104
138
  position: relative;
105
139
  z-index: 1;
106
140
  }
@@ -108,7 +142,9 @@
108
142
  // Zero specificity on purpose: it is a floor, not a rule. A section that
109
143
  // paints its own surface - mw-section-alternate, a project's own band - has
110
144
  // to win here, and this file is forwarded last.
111
- :where(.mw-parallax-sticky ~ *) {
145
+ :where(
146
+ :is(.mw-parallax-sticky, .mw-parallax-slow) ~ *:not(.mw-parallax-sticky)
147
+ ) {
112
148
  background: var(--mw-page-background);
113
149
  }
114
150
 
@@ -116,7 +152,9 @@
116
152
  // text goes light. A band without content on it needs neither.
117
153
  .mw-parallax-dimmed {
118
154
  > .mw-parallax-media {
119
- filter: brightness(0.5);
155
+ // $hero-filter-dark's value, not the token: that one flips to 1.1 in the
156
+ // light theme, and this band's ink stays light in both
157
+ filter: brightness(0.7);
120
158
  }
121
159
 
122
160
  > .mw-parallax-content {
@@ -155,10 +193,10 @@
155
193
  }
156
194
  }
157
195
 
158
- // Firefox ships no scroll timelines, so there the script writes the progress
159
- // and the travel is worked out here (main.js). Keeping the transform in CSS
160
- // is what lets every depth variant above - and an inline
161
- // `--mw-parallax-depth` - go on working untouched.
196
+ // Older Safari and Firefox ship no scroll timelines, so there the script
197
+ // writes the progress and the travel is worked out here (main.js). Keeping
198
+ // the transform in CSS is what lets every depth variant above - and an
199
+ // inline `--mw-parallax-depth` - go on working untouched.
162
200
  //
163
201
  // 0 puts the layer at +depth and 1 at -depth, the two ends of the keyframes.
164
202
  @media (prefers-reduced-motion: no-preference) {
@@ -171,6 +209,16 @@
171
209
  }
172
210
  }
173
211
 
212
+ @keyframes mw-parallax-band {
213
+ from {
214
+ transform: translateY(0);
215
+ }
216
+
217
+ to {
218
+ transform: translateY(var(--mw-parallax-slow-travel));
219
+ }
220
+ }
221
+
174
222
  @keyframes mw-parallax {
175
223
  from {
176
224
  transform: translate3d(0, var(--mw-parallax-depth), 0);
@@ -35,11 +35,11 @@
35
35
  }
36
36
  }
37
37
 
38
- // Firefox ships no scroll timelines at all, so there the script drives the
39
- // same movement (main.js): `mw-reveal-hidden` while the element waits below
40
- // the fold, `mw-reveal-run` once it enters. Both classes are added by the
41
- // script and never by the markup - a page without JS keeps everything
42
- // visible, which is what the guard above is for.
38
+ // Older Safari and Firefox ship no scroll timelines, so there the script
39
+ // drives the same movement (main.js): `mw-reveal-hidden` while the element
40
+ // waits below the fold, `mw-reveal-run` once it enters. Both classes are
41
+ // added by the script and never by the markup - a page without JS keeps
42
+ // everything visible, which is what the guard above is for.
43
43
  @media (prefers-reduced-motion: no-preference) {
44
44
  .mw-reveal-hidden {
45
45
  opacity: 0;