3333 * 6. Prevent adjustments of font size after orientation changes in iOS.
3434 */
3535
36- html {
36+ : where ( : root ) {
3737 cursor : default; /* 1 */
3838 line-height : 1.5 ; /* 2 */
39- overflow-wrap : anywhere ; /* 3 */
39+ overflow-wrap : break-word ; /* 3 */
4040 -moz-tab-size : 4 ; /* 4 */
4141 tab-size : 4 ; /* 4 */
4242 -webkit-tap-highlight-color : transparent /* 5 */ ;
5050 * Remove the margin in all browsers (opinionated).
5151 */
5252
53- body {
53+ : where ( body ) {
5454 margin : 0 ;
5555}
5656
5959 * `article` contexts in Chrome, Edge, Firefox, and Safari.
6060 */
6161
62- h1 {
62+ : where ( h1 ) {
6363 font-size : 2em ;
6464 margin : 0.67em 0 ;
6565}
7171 * Remove the margin on nested lists in Chrome, Edge, and Safari.
7272 */
7373
74- dl dl ,
75- dl ol ,
76- dl ul ,
77- ol dl ,
78- ul dl {
74+ : where (dl , ol , ul ) : where (dl , ol , ul ) {
7975 margin : 0 ;
8076}
8177
@@ -84,7 +80,7 @@ ul dl {
8480 * 2. Add the correct box sizing in Firefox.
8581 */
8682
87- hr {
83+ : where ( hr ) {
8884 color : inherit; /* 1 */
8985 height : 0 ; /* 2 */
9086}
9389 * Remove the list style on navigation lists in all browsers (opinionated).
9490 */
9591
96- nav ol ,
97- nav ul {
98- list-style : url ("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E" );
92+ : where (nav ) : where (ol , ul ) {
93+ list-style-type : none;
9994 padding : 0 ;
10095}
10196
10297/**
10398 * Prevent VoiceOver from ignoring list semantics in Safari (opinionated).
10499 */
105100
106- nav li ::before {
101+ : where ( nav li ) ::before {
107102 content : "\200B" ;
108103}
109104
@@ -113,7 +108,7 @@ nav li::before {
113108 * 3. Prevent overflow of the container in all browsers (opinionated).
114109 */
115110
116- pre {
111+ : where ( pre ) {
117112 font-family : monospace, monospace; /* 1 */
118113 font-size : 1em ; /* 2 */
119114 overflow : auto; /* 3 */
@@ -126,7 +121,7 @@ pre {
126121 * Add the correct text decoration in Safari.
127122 */
128123
129- abbr [title ] {
124+ : where ( abbr [title ]) {
130125 text-decoration : underline;
131126 text-decoration : underline dotted;
132127}
@@ -135,8 +130,7 @@ abbr[title] {
135130 * Add the correct font weight in Chrome, Edge, and Safari.
136131 */
137132
138- b ,
139- strong {
133+ : where (b , strong ) {
140134 font-weight : bolder;
141135}
142136
@@ -145,9 +139,7 @@ strong {
145139 * 2. Correct the odd `em` font sizing in all browsers.
146140 */
147141
148- code ,
149- kbd ,
150- samp {
142+ : where (code , kbd , samp ) {
151143 font-family : monospace, monospace; /* 1 */
152144 font-size : 1em ; /* 2 */
153145}
@@ -156,7 +148,7 @@ samp {
156148 * Add the correct font size in all browsers.
157149 */
158150
159- small {
151+ : where ( small ) {
160152 font-size : 80% ;
161153}
162154
@@ -167,37 +159,23 @@ small {
167159 * Change the alignment on media elements in all browsers (opinionated).
168160 */
169161
170- audio ,
171- canvas ,
172- iframe ,
173- img ,
174- svg ,
175- video {
162+ : where (audio , canvas , iframe , img , svg , video ) {
176163 vertical-align : middle;
177164}
178165
179- /**
180- * Add the correct display in iOS 4-7.
181- */
182-
183- audio : not ([controls ]) {
184- display : none;
185- height : 0 ;
186- }
187-
188166/**
189167 * Remove the border on iframes in all browsers (opinionated).
190168 */
191169
192- iframe {
170+ : where ( iframe ) {
193171 border-style : none;
194172}
195173
196174/**
197175 * Change the fill color to match the text color in all browsers (opinionated).
198176 */
199177
200- svg : not ([fill ]) {
178+ : where ( svg : not ([fill ]) ) {
201179 fill : currentColor;
202180}
203181
@@ -210,7 +188,7 @@ svg:not([fill]) {
210188 * 3. Remove text indentation from table contents in Chrome, Edge, and Safari.
211189 */
212190
213- table {
191+ : where ( table ) {
214192 border-collapse : collapse; /* 1 */
215193 border-color : inherit; /* 2 */
216194 text-indent : 0 ; /* 3 */
@@ -223,63 +201,40 @@ table {
223201 * Remove the margin on controls in Safari.
224202 */
225203
226- button ,
227- input ,
228- select {
204+ : where (button , input , select ) {
229205 margin : 0 ;
230206}
231207
232- /**
233- * Remove the inheritance of text transform in Firefox.
234- */
235-
236- button {
237- text-transform : none;
238- }
239-
240208/**
241209 * Correct the inability to style buttons in iOS and Safari.
242210 */
243211
244- button ,
245- [type = "button" i],
246- [type = "reset" i],
247- [type = "submit" i] {
212+ : where (button , [type = "button" i], [type = "reset" i], [type = "submit" i]) {
248213 -webkit-appearance : button;
249214}
250215
251216/**
252- * 1. Change the inconsistent appearance in all browsers (opinionated).
253- * 2. Correct the padding in Firefox.
217+ * Change the inconsistent appearance in all browsers (opinionated).
254218 */
255219
256- fieldset {
257- border : 1px solid # a0a0a0 ; /* 1 */
258- padding : 0.35em 0.75em 0.625em ; /* 2 */
220+ : where (fieldset ) {
221+ border : 1px solid # a0a0a0 ;
259222}
260223
261224/**
262225 * Add the correct vertical alignment in Chrome, Edge, and Firefox.
263226 */
264227
265- progress {
228+ : where ( progress ) {
266229 vertical-align : baseline;
267230}
268231
269- /**
270- * Remove the inheritance of text transform in Firefox.
271- */
272-
273- select {
274- text-transform : none;
275- }
276-
277232/**
278233 * 1. Remove the margin in Firefox and Safari.
279234 * 3. Change the resize direction in all browsers (opinionated).
280235 */
281236
282- textarea {
237+ : where ( textarea ) {
283238 margin : 0 ; /* 1 */
284239 resize : vertical; /* 3 */
285240}
@@ -289,7 +244,7 @@ textarea {
289244 * 2. Correct the outline style in Safari.
290245 */
291246
292- [type = "search" i] {
247+ : where ( [type = "search" i]) {
293248 -webkit-appearance : textfield; /* 1 */
294249 outline-offset : -2px ; /* 2 */
295250}
@@ -347,47 +302,37 @@ textarea {
347302 outline : 1px dotted ButtonText;
348303}
349304
350- /**
351- * Remove the additional :invalid styles in Firefox.
352- */
353-
354- : -moz-ui-invalid {
355- box-shadow : none;
356- }
357-
358305/* Interactive
359306 * ========================================================================== */
360307
361308/*
362309 * Add the correct styles in Safari.
363310 */
364311
365- dialog {
312+ : where ( dialog ) {
366313 background-color : white;
367314 border : solid;
368315 color : black;
369316 height : -moz-fit-content;
370- height : -webkit-fit-content;
371317 height : fit-content;
372318 left : 0 ;
373319 margin : auto;
374320 padding : 1em ;
375321 position : absolute;
376322 right : 0 ;
377323 width : -moz-fit-content;
378- width : -webkit-fit-content;
379324 width : fit-content;
380325}
381326
382- dialog : not ([open ]) {
327+ : where ( dialog : not ([open ]) ) {
383328 display : none;
384329}
385330
386331/*
387- * Add the correct display in all browsers .
332+ * Add the correct display in Safari .
388333 */
389334
390- summary {
335+ : where ( details > summary : first-of-type ) {
391336 display : list-item;
392337}
393338
@@ -398,15 +343,15 @@ summary {
398343 * Change the cursor on busy elements in all browsers (opinionated).
399344 */
400345
401- [aria-busy = "true" i] {
346+ : where ( [aria-busy = "true" i]) {
402347 cursor : progress;
403348}
404349
405350/*
406351 * Change the cursor on control elements in all browsers (opinionated).
407352 */
408353
409- [aria-controls ] {
354+ : where ( [aria-controls ]) {
410355 cursor : pointer;
411356}
412357
@@ -415,8 +360,7 @@ summary {
415360 * inoperable elements in all browsers (opinionated).
416361 */
417362
418- [aria-disabled = "true" i],
419- [disabled ] {
363+ : where ([aria-disabled = "true" i], [disabled ]) {
420364 cursor : not-allowed;
421365}
422366
@@ -425,11 +369,11 @@ summary {
425369 * in all browsers (opinionated).
426370 */
427371
428- [aria-hidden = "false" i][hidden ] {
372+ : where ( [aria-hidden = "false" i][hidden ]) {
429373 display : initial;
430374}
431375
432- [aria-hidden = "false" i][hidden ]: not (: focus ) {
376+ : where ( [aria-hidden = "false" i][hidden ]: not (: focus ) ) {
433377 clip : rect (0 , 0 , 0 , 0 );
434378 position : absolute;
435379}
0 commit comments