maverick-wave 4.14.0 → 4.15.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.
@@ -0,0 +1,222 @@
1
+ @use '../abstracts' as *;
2
+
3
+ // The word variant is set down from the price size and then has to climb back
4
+ // to its line box - the two numbers only work as a pair, so they are named.
5
+ $_mw-price-line-height: 1.1;
6
+ $_mw-price-word-scale: 0.68;
7
+
8
+ // ---------------------------------------------------------------------------
9
+ // Price
10
+ //
11
+ // The figure, not the card around it: one baseline row holding the price that
12
+ // was, the price that is, the unit and a discount tag.
13
+ //
14
+ // Every part is sized in `em` off a single token, so the size variants only
15
+ // have to retune `--mw-price-size` and the whole row moves together - cents,
16
+ // currency and struck-through original included.
17
+ // ---------------------------------------------------------------------------
18
+
19
+ .mw-price {
20
+ --mw-price-size: #{font-size('3xl')};
21
+
22
+ display: flex;
23
+ flex-wrap: wrap;
24
+ // Baseline, not centre: figure and words are read as one line of text, and
25
+ // centring a 0.45em word against a 2.2rem number floats it in the middle of
26
+ // the digits instead of sitting it on them.
27
+ align-items: baseline;
28
+ gap: spacing('2') spacing('3');
29
+ margin: spacing('0');
30
+ font-size: var(--mw-price-size);
31
+ line-height: $_mw-price-line-height;
32
+ color: var(--mw-primary-text-color);
33
+
34
+ // A pill is a box, not a word - on the baseline it hangs off the bottom of
35
+ // the digits. Centre is where the eye looks for it.
36
+ > .mw-tag,
37
+ > .mw-badge {
38
+ align-self: center;
39
+ flex-shrink: 0;
40
+ }
41
+
42
+ &-amount {
43
+ font-weight: font-weight('bold');
44
+ // Two prices under each other line up, and a figure swapped by a billing
45
+ // toggle does not jump sideways on the way
46
+ font-variant-numeric: tabular-nums lining-nums;
47
+ font-feature-settings: 'tnum', 'lnum';
48
+ white-space: nowrap;
49
+ }
50
+
51
+ // Cents, written inside the amount. One step down and left on the baseline -
52
+ // cents raised to the cap height are a discounter's idiom, and a service
53
+ // price that borrows it reads cheaper than it is.
54
+ &-fraction {
55
+ font-size: 0.62em;
56
+ font-weight: font-weight('medium');
57
+ }
58
+
59
+ // "Euro", "CHF", "€" - the unit, not the number, so it does not carry the
60
+ // weight either.
61
+ //
62
+ // The floor is where the `em` chain stops being useful: 0.45 of an
63
+ // `mw-price-sm` is 11px, and that is the size most offer cards run at.
64
+ &-currency {
65
+ font-size: max(0.45em, #{font-size('xs')});
66
+ font-weight: font-weight('normal');
67
+ }
68
+
69
+ // What it cost before the discount. Muted *and* struck: muted alone reads as
70
+ // a footnote, the line is what says "this is no longer the price".
71
+ //
72
+ // The rule is drawn explicitly, because the browser default is a hairline
73
+ // that vanishes at this size against a muted tone.
74
+ &-original {
75
+ // Floored higher than the unit - this one is a figure, and a reader has to
76
+ // be able to compare it with the one next to it
77
+ font-size: max(0.5em, #{font-size('sm')});
78
+ font-weight: font-weight('normal');
79
+ color: var(--mw-text-muted-color);
80
+ text-decoration: line-through;
81
+ text-decoration-thickness: 0.09em;
82
+ white-space: nowrap;
83
+ }
84
+
85
+ // "/ month", "per session" - what the price is per
86
+ &-period {
87
+ font-size: max(0.42em, #{font-size('xs')});
88
+ font-weight: font-weight('normal');
89
+ color: var(--mw-text-muted-color);
90
+ }
91
+
92
+ // "On request", "free" - not a figure, so not set like one. Still bold, so it
93
+ // holds the same slot in a row of cards as a real price would.
94
+ //
95
+ // The line height is scaled back up to the one a full-size amount has: a row
96
+ // of offers puts "On request" next to "129", and a shorter line box would sit
97
+ // that card's price a few pixels out of line with its neighbours.
98
+ &-word {
99
+ font-size: $_mw-price-word-scale * 1em;
100
+ line-height: calc(#{$_mw-price-line-height}em / #{$_mw-price-word-scale});
101
+ font-weight: font-weight('bold');
102
+ }
103
+
104
+ // The line under a price - what it includes, what it saves. A *sibling* of
105
+ // the row, not a child: inside it, it would inherit the price size and be a
106
+ // flex item on the same baseline.
107
+ &-note {
108
+ margin: spacing('2') spacing('0') spacing('0');
109
+ font-size: font-size('sm');
110
+ color: var(--mw-text-muted-color);
111
+ }
112
+ }
113
+
114
+ // Size. Only the token moves - see the `em` above.
115
+ .mw-price-sm {
116
+ --mw-price-size: #{font-size('xl')};
117
+ }
118
+
119
+ .mw-price-lg {
120
+ --mw-price-size: #{font-size('5xl')};
121
+ }
122
+
123
+ // The old price on its own line above the new one - for a narrow card where the
124
+ // row would otherwise wrap at whatever point it runs out of width. The
125
+ // `flex-basis` is the line break: a wrapper element around the rest would do
126
+ // the same job and cost an element in every price on the page.
127
+ .mw-price-stacked .mw-price-original {
128
+ flex-basis: 100%;
129
+ margin-bottom: spacing('-1');
130
+ }
131
+
132
+ .mw-price-center {
133
+ justify-content: center;
134
+ }
135
+
136
+ // Body colour instead of the brand - for a table row or a list where a coloured
137
+ // price would be the loudest thing on screen for no reason.
138
+ .mw-price-plain {
139
+ color: var(--mw-text-color);
140
+ }
141
+
142
+ // ---------------------------------------------------------------------------
143
+ // Offer card
144
+ //
145
+ // The card a price is sold from: what you get, what it costs, the button that
146
+ // asks for it. Deliberately thin - shell, body and footer are `mw-card`'s, this
147
+ // adds only what selling something needs.
148
+ // ---------------------------------------------------------------------------
149
+
150
+ .mw-offer {
151
+ // Prices in a row of offers have to sit on one line, and the feature lists
152
+ // are never the same length. Pushed down rather than positioned: the grid
153
+ // already stretches the cards to equal height, so "as far down as it goes"
154
+ // resolves to the same line in every card of the row.
155
+ > .mw-card-body > .mw-price {
156
+ margin-top: auto;
157
+ padding-top: spacing('5');
158
+ }
159
+
160
+ // The card body already pushes its footer down the same way. Two `auto`
161
+ // margins in one column *share* the free space instead of collecting it above
162
+ // the first, which leaves the price floating somewhere in the middle and at a
163
+ // different height in every card - so the footer gives its own up as soon as
164
+ // a price stands in front of it.
165
+ //
166
+ // Bottom-aligned, note included: a card that carries a `mw-price-note` and
167
+ // one that does not will not have their prices on the same line. Give every
168
+ // card in a row a note, or none of them.
169
+ > .mw-card-body > .mw-price ~ .mw-card-footer {
170
+ margin-top: spacing('0');
171
+ }
172
+
173
+ // A solid band across the top carrying the name and the price - the layout
174
+ // for when the price is the thing being compared and the feature list is
175
+ // only its justification. Colour comes from `mw-card-addon-*` on the card,
176
+ // the same set the card badge and the ribbon read.
177
+ &-head {
178
+ display: flex;
179
+ flex-direction: column;
180
+ align-items: center;
181
+ gap: spacing('2');
182
+ padding: spacing('6') spacing('5');
183
+ // The card's own radius minus its border - the band sits inside it
184
+ border-radius: (radius('sm') - 1px) (radius('xl') - 1px) 0 0;
185
+ background: var(--mw-card-addon-color, var(--mw-primary-color));
186
+ color: var(--mw-card-addon-text-color, var(--mw-primary-accent-text-color));
187
+ text-align: center;
188
+
189
+ // On a solid fill the price cannot keep the brand colour, and the muted
190
+ // parts cannot keep a grey that was mixed against the page background
191
+ .mw-price,
192
+ .mw-price-original,
193
+ .mw-price-period {
194
+ color: inherit;
195
+ }
196
+
197
+ .mw-price-original,
198
+ .mw-price-period {
199
+ opacity: 0.7;
200
+ }
201
+ }
202
+
203
+ &-name {
204
+ margin: spacing('0');
205
+ font-size: font-size('md');
206
+ font-weight: font-weight('bold');
207
+ letter-spacing: 0.06em;
208
+ text-transform: uppercase;
209
+ }
210
+
211
+ // With a band above it the body no longer opens the card, so it does not need
212
+ // the air a card top usually gets
213
+ &-head + .mw-card-body {
214
+ padding-top: spacing('6');
215
+ }
216
+ }
217
+
218
+ // The band owns the top-right corner. An arc drawn over it either disappears
219
+ // into the fill or fights it - the same call the coloured panel header makes.
220
+ .mw-offer:has(> .mw-offer-head)::after {
221
+ @include corner-accent(1px, 'bottom');
222
+ }
@@ -65,6 +65,18 @@
65
65
  background: var(--mw-primary-color);
66
66
  border-color: var(--mw-primary-text-color);
67
67
  color: var(--mw-primary-accent-text-color);
68
+
69
+ // A tag inside an item - the saving on a billing cycle, a count on a
70
+ // filter. Its colour variants mix their background from the *page*, so on
71
+ // the active item's fill they come out muddy: an orange pill on blue turns
72
+ // purple. On that one the tag borrows the item's own ink; on the others it
73
+ // keeps its colour, which is what makes a visitor click it in the first
74
+ // place.
75
+ .mw-tag {
76
+ background: transparent;
77
+ border-color: currentColor;
78
+ color: inherit;
79
+ }
68
80
  }
69
81
  }
70
82