33
44/**
55 * 1. Correct the line height in all browsers.
6- * 2. Prevent adjustments of font size after orientation changes in iOS.
76 */
87
9- html {
8+ : where ( html ) {
109 line-height : 1.15 ; /* 1 */
11- -webkit-text-size-adjust : 100% ; /* 2 */
1210}
1311
1412/* Sections
@@ -19,9 +17,10 @@ html {
1917 * `article` contexts in Chrome, Edge, Firefox, and Safari.
2018 */
2119
22- h1 {
20+ : where ( h1 ) {
2321 font-size : 2em ;
24- margin : 0.67em 0 ;
22+ margin-block-end : 0.67em ;
23+ margin-block-start : 0.67em ;
2524}
2625
2726/* Grouping content
3130 * Remove the margin on nested lists in Chrome, Edge, and Safari.
3231 */
3332
34- dl dl ,
35- dl ol ,
36- dl ul ,
37- ol dl ,
38- ul dl {
39- margin : 0 ;
33+ : where (dl : is (dl , ol , ul ), : is (ol , ul ) dl ) {
34+ margin-block-end : 0 ;
35+ margin-block-start : 0 ;
4036}
4137
4238/**
4339 * 1. Add the correct box sizing in Firefox.
4440 * 2. Correct the inheritance of border color in Firefox.
4541 */
4642
47- hr {
43+ : where ( hr ) {
4844 box-sizing : content-box; /* 1 */
4945 color : inherit; /* 2 */
5046 height : 0 ; /* 1 */
5551 * 2. Correct the odd `em` font sizing in all browsers.
5652 */
5753
58- pre {
54+ : where ( pre ) {
5955 font-family : monospace, monospace; /* 1 */
6056 font-size : 1em ; /* 2 */
6157}
6763 * Add the correct text decoration in Safari.
6864 */
6965
70- abbr [title ] {
66+ : where ( abbr [title ]) {
7167 text-decoration : underline;
7268 text-decoration : underline dotted;
7369}
@@ -76,8 +72,7 @@ abbr[title] {
7672 * Add the correct font weight in Chrome, Edge, and Safari.
7773 */
7874
79- b ,
80- strong {
75+ : where (b , strong ) {
8176 font-weight : bolder;
8277}
8378
@@ -86,9 +81,7 @@ strong {
8681 * 2. Correct the odd `em` font sizing in all browsers.
8782 */
8883
89- code ,
90- kbd ,
91- samp {
84+ : where (code , kbd , samp ) {
9285 font-family : monospace, monospace; /* 1 */
9386 font-size : 1em ; /* 2 */
9487}
9790 * Add the correct font size in all browsers.
9891 */
9992
100- small {
93+ : where ( small ) {
10194 font-size : 80% ;
10295}
10396
@@ -108,7 +101,7 @@ small {
108101 * Add the correct display in iOS 4-7.
109102 */
110103
111- audio : not ([controls ]) {
104+ : where ( audio : not ([controls ]) ) {
112105 display : none;
113106 height : 0 ;
114107}
@@ -121,7 +114,7 @@ audio:not([controls]) {
121114 * 2. Remove text indentation from table contents in Chrome, Edge, and Safari.
122115 */
123116
124- table {
117+ : where ( table ) {
125118 border-color : inherit; /* 1 */
126119 text-indent : 0 ; /* 2 */
127120}
@@ -133,60 +126,47 @@ table {
133126 * Remove the margin on controls in Safari.
134127 */
135128
136- button ,
137- input ,
138- select {
129+ : where (button , input , select ) {
139130 margin : 0 ;
140131}
141132
142133/**
143134 * Remove the inheritance of text transform in Firefox.
144135 */
145136
146- button {
137+ : where ( button ) {
147138 text-transform : none;
148139}
149140
150141/**
151142 * Correct the inability to style buttons in iOS and Safari.
152143 */
153144
154- button ,
155- [type = "button" i],
156- [type = "reset" i],
157- [type = "submit" i] {
145+ : where (button , input : is ([type = "button" i], [type = "reset" i], [type = "submit" i])) {
158146 -webkit-appearance : button;
159147}
160148
161- /**
162- * Correct the padding in Firefox.
163- */
164-
165- fieldset {
166- padding : 0.35em 0.75em 0.625em ;
167- }
168-
169149/**
170150 * Add the correct vertical alignment in Chrome, Edge, and Firefox.
171151 */
172152
173- progress {
153+ : where ( progress ) {
174154 vertical-align : baseline;
175155}
176156
177157/**
178158 * Remove the inheritance of text transform in Firefox.
179159 */
180160
181- select {
161+ : where ( select ) {
182162 text-transform : none;
183163}
184164
185165/**
186166 * Remove the margin in Firefox and Safari.
187167 */
188168
189- textarea {
169+ : where ( textarea ) {
190170 margin : 0 ;
191171}
192172
@@ -195,7 +175,7 @@ textarea {
195175 * 2. Correct the outline style in Safari.
196176 */
197177
198- [type = "search" i] {
178+ : where ( input [type = "search" i]) {
199179 -webkit-appearance : textfield; /* 1 */
200180 outline-offset : -2px ; /* 2 */
201181}
@@ -204,16 +184,15 @@ textarea {
204184 * Correct the cursor style of increment and decrement buttons in Safari.
205185 */
206186
207- ::-webkit-inner-spin-button ,
208- ::-webkit-outer-spin-button {
187+ : where (input ::-webkit-inner-spin-button , input ::-webkit-outer-spin-button ) {
209188 height : auto;
210189}
211190
212191/**
213192 * Correct the text style of placeholders in Chrome, Edge, and Safari.
214193 */
215194
216- :: -webkit-input-placeholder {
195+ : where ( input :: -webkit-input-placeholder ) {
217196 color : inherit;
218197 opacity : 0.54 ;
219198}
@@ -222,7 +201,7 @@ textarea {
222201 * Remove the inner padding in Chrome, Edge, and Safari on macOS.
223202 */
224203
225- :: -webkit-search-decoration {
204+ : where ( input [ type = "search" i]:: -webkit-search-decoration ) {
226205 -webkit-appearance : none;
227206}
228207
@@ -231,7 +210,7 @@ textarea {
231210 * 2. Change font properties to `inherit` in Safari.
232211 */
233212
234- :: -webkit-file-upload-button {
213+ : where ( input [ type = "file" i]:: -webkit-file-upload-button ) {
235214 -webkit-appearance : button; /* 1 */
236215 font : inherit; /* 2 */
237216}
@@ -240,7 +219,7 @@ textarea {
240219 * Remove the inner border and padding of focus outlines in Firefox.
241220 */
242221
243- :: -moz-focus-inner {
222+ : where ( : is ( button , input : is ([ type = "button" i] , [ type = "color" i] , [ type = "reset" i] , [ type = "submit" i])):: -moz-focus-inner ) {
244223 border-style : none;
245224 padding : 0 ;
246225}
@@ -249,15 +228,15 @@ textarea {
249228 * Restore the focus outline styles unset by the previous rule in Firefox.
250229 */
251230
252- : -moz-focusring {
231+ : where ( : is ( button , input : is ([ type = "button" i] , [ type = "color" i] , [ type = "reset" i] , [ type = "submit" i])) : -moz-focusring ) {
253232 outline : 1px dotted ButtonText;
254233}
255234
256235/**
257236 * Remove the additional :invalid styles in Firefox.
258237 */
259238
260- : -moz-ui-invalid {
239+ : where ( : -moz-ui-invalid ) {
261240 box-shadow : none;
262241}
263242
@@ -268,7 +247,7 @@ textarea {
268247 * Add the correct styles in Safari.
269248 */
270249
271- dialog {
250+ : where ( dialog ) {
272251 background-color : white;
273252 border : solid;
274253 color : black;
@@ -285,14 +264,14 @@ dialog {
285264 width : fit-content;
286265}
287266
288- dialog : not ([open ]) {
267+ : where ( dialog : not ([open ]) ) {
289268 display : none;
290269}
291270
292271/*
293272 * Add the correct display in all browsers.
294273 */
295274
296- summary {
275+ : where ( summary ) {
297276 display : list-item;
298277}
0 commit comments