Skip to content

Commit 4867dab

Browse files
committed
Use :where() in evergreen.css, remove text-size-adjust
1 parent 41fbcb3 commit 4867dab

7 files changed

Lines changed: 40 additions & 88 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
npm-debug.log
3+
yarn.lock
34
.*
45
!.editorconfig
56
!.gitignore

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes to @csstools/normalize.css
22

3+
### HEAD
4+
5+
- Changed: Evergreen variations of normalize.css contribute no specificity.
6+
- Removed: `fieldset` padding in Firefox is no longer needed.
7+
- Removed: `text-size-adjust` is no longer needed.
8+
39
### 11.0.1 (August 20, 2020)
410

511
- Fixed: Used case-insensitive attribute selectors in the evergreen variations.

evergreen.css

Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
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
@@ -31,20 +30,17 @@ h1 {
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 */
@@ -55,7 +51,7 @@ hr {
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
}
@@ -67,7 +63,7 @@ pre {
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
}
@@ -97,7 +90,7 @@ samp {
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
}

normalize.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
/**
55
* 1. Correct the line height in all browsers.
6-
* 2. Prevent adjustments of font size after orientation changes in
7-
* IE on Windows Phone and in iOS.
86
*/
97

108
html {
119
line-height: 1.15; /* 1 */
12-
-ms-text-size-adjust: 100%; /* 2 */
13-
-webkit-text-size-adjust: 100%; /* 2 */
1410
}
1511

1612
/* Sections
@@ -216,14 +212,6 @@ button,
216212
-webkit-appearance: button;
217213
}
218214

219-
/**
220-
* Correct the padding in Firefox.
221-
*/
222-
223-
fieldset {
224-
padding: 0.35em 0.75em 0.625em;
225-
}
226-
227215
/**
228216
* Show the overflow in Edge 18- and IE.
229217
*/

opinionated.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33

44
/**
55
* 1. Correct the line height in all browsers.
6-
* 2. Prevent adjustments of font size after orientation changes in
7-
* IE on Windows Phone and in iOS.
86
*/
97

108
html {
119
line-height: 1.15; /* 1 */
12-
-ms-text-size-adjust: 100%; /* 2 */
13-
-webkit-text-size-adjust: 100%; /* 2 */
1410
}
1511

1612
/* Sections
@@ -224,14 +220,6 @@ button,
224220
-webkit-appearance: button;
225221
}
226222

227-
/**
228-
* Correct the padding in Firefox.
229-
*/
230-
231-
fieldset {
232-
padding: 0.35em 0.75em 0.625em;
233-
}
234-
235223
/**
236224
* Show the overflow in Edge 18- and IE.
237225
*/

opinionated.evergreen.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
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

98
html {
109
line-height: 1.15; /* 1 */
11-
-webkit-text-size-adjust: 100%; /* 2 */
1210
}
1311

1412
/* Sections
@@ -166,14 +164,6 @@ button,
166164
-webkit-appearance: button;
167165
}
168166

169-
/**
170-
* Correct the padding in Firefox.
171-
*/
172-
173-
fieldset {
174-
padding: 0.35em 0.75em 0.625em;
175-
}
176-
177167
/**
178168
* Add the correct vertical alignment in Chrome, Edge, and Firefox.
179169
*/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"test": "stylelint normalize.css evergreen.css opinionated.css opinionated.evergreen.css"
2626
},
2727
"devDependencies": {
28-
"stylelint": "^13.6.1",
28+
"stylelint": "^13.8.0",
2929
"stylelint-config-standard": "^20.0.0"
3030
},
3131
"stylelint": {

0 commit comments

Comments
 (0)