Skip to content

Commit 6faee43

Browse files
committed
10.0.0
1 parent 804b41e commit 6faee43

7 files changed

Lines changed: 161 additions & 61 deletions

File tree

CHANGELOG.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changes to sanitize.css
22

3+
### 10.0.0 (June 3, 2019)
4+
5+
- Added: Opinionated page measure via `page.css`.
6+
- Added: Opinionated `border` normalization on form controls to match UA.
7+
- Added: Opinionated `font` and `letter-spacing` as `inherit` on form controls.
8+
- Added: Opinionated normalization of select controls.
9+
- Added: Opinionated normalization of placeholders in Internet Explorer.
10+
- Added: Opinionated `border` removal on iframes in all browsers.
11+
- Removed: Opinionated `border-radius` on form controls.
12+
- Removed: Opinionated `box-shadow` on form controls to match UA expectations.
13+
- Fixed: `Edge` comments without `Chrome` are are changed to `Edge 18-`.
14+
- Fixed: `Chrome` comments without `Edge` have `Edge` added.
15+
- Fixed: Nested list `dl` normalizations split.
16+
- Fixed: Logical `margin-block` normalization changed to `margin`.
17+
- Fixed: Used consistent quotes around typefaces in `typography.css`.
18+
19+
> These fixes were brought in from normalize.css v10.1.0.
20+
321
### 9.0.0 (May 16, 2019)
422

523
- Removed: Opinionated removal of text shadow on text selections due to bugs in
@@ -29,27 +47,25 @@
2947

3048
### 7.0.2 (September 4, 2018)
3149

32-
- Restore form control margin normalizations in Firefox
33-
- Re-order a few rules (opinionated)
50+
- Fixed: Restored form control margin normalizations in Firefox
51+
- Updated: Ordering of a few rules (opinionated)
3452

3553
### 7.0.1 (August 25, 2018)
3654

37-
- Support the 4-space tab width in Firefox (opinionated)
38-
- Update documentation
55+
- Added: Support the 4-space tab width in Firefox (opinionated)
3956

4057
### 7.0.0 (August 22, 2018)
4158

42-
- Use the default user interface font in all browsers (opinionated)
43-
- Use the default monospace user interface font in all browsers (opinionated)
44-
- Use a 4-space tab width in all browsers (opinionated)
45-
- Fix correction of cursor style of increment and decrement buttons
46-
in Safari, not Chrome
47-
- Correct the text style of placeholders in Chrome, Edge, and Safari
48-
- Remove unnecessary form control margin normalizations in Firefox
49-
- Remove opinionated fieldset padding in all browsers
50-
- Remove `::-moz-focus-inner` and `:-moz-focusring` normalizations
51-
fixed in Firefox 53
52-
https://bugzilla.mozilla.org/show_bug.cgi?id=140562
59+
- Added: System font in all browsers (opinionated)
60+
- Added: System monospace user interface font in all browsers (opinionated)
61+
- Added: 4-space tab width in all browsers (opinionated)
62+
- Removed: Unnecessary form control margin normalizations in Firefox
63+
- Removed: Opinionated fieldset padding in all browsers
64+
- Removed: Normalzations for `::-moz-focus-inner` and `:-moz-focusring` fixed
65+
in Firefox 53 (https://bugzilla.mozilla.org/show_bug.cgi?id=140562)
66+
- Fixed: Correction of cursor style of increment and decrement buttons in
67+
Safari, not Chrome
68+
- Fixed: Text style of placeholders in Chrome, Edge, and Safari
5369

5470
### 6.0.0 (June 24, 2018)
5571

@@ -79,8 +95,7 @@
7995
- Added: Documentation for each opinionated feature
8096
- Added: Universal `background-repeat: no-repeat`
8197
- Removed: Reset of universal `margin` and `padding`
82-
- Removed: Inheritance of `font-size` on elements
83-
(form control elements still have it)
98+
- Removed: Inheritance of `font-size` on elements (form controls still have it)
8499
- Removed: Pre-compiled files that used variables
85100
- Updated: `abbr[title]` styled using `border-bottom` over `text-decoration`
86101
- Updated: Tests and linting
@@ -166,7 +181,7 @@ accurately indicate your changes coming from your files.
166181
- Added: `font-style` inheritance
167182
- Updated: Support for the latest **Firefox**
168183
- Removed: Redundant inheritance in ::before and ::after
169-
- Removed: redundant cursor inheritance in anchor and form elements
184+
- Removed: redundant cursor inheritance in anchor and form controls
170185

171186
### 1.1.0 (March 20, 2015)
172187

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,34 @@ documented.
1313
<link href="https://unpkg.com/sanitize.css" rel="stylesheet" />
1414
```
1515

16-
A separate stylesheet normalizes typography using system interface fonts.
16+
### Forms
17+
18+
A separate stylesheet that normalizes form controls without side effects.
19+
20+
```html
21+
<link href="https://unpkg.com/sanitize.css/forms.css" rel="stylesheet" />
22+
```
23+
24+
A separate stylesheet that sizes form controls without affecting native styles.
25+
26+
```html
27+
<link href="https://unpkg.com/sanitize.css/formsize.css" rel="stylesheet" />
28+
```
29+
30+
### Typography
31+
32+
A separate stylesheet that normalizes typography using system interface fonts.
1733

1834
```html
1935
<link href="https://unpkg.com/sanitize.css/typography.css" rel="stylesheet" />
2036
```
2137

22-
A separate stylesheet normalizes forms using minimal, standards-like styling.
38+
### Measure
39+
40+
A separate stylesheet that applies a comfortable measure to the page.
2341

2442
```html
25-
<link href="https://unpkg.com/sanitize.css/forms.css" rel="stylesheet" />
43+
<link href="https://unpkg.com/sanitize.css/measure.css" rel="stylesheet" />
2644
```
2745

2846
### Install

forms.css

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,44 @@
11
/**
2-
* 1. Use standards-like styling in all browsers (opinionated).
3-
* 2. Inherit typography styling in all browsers (opinionated).
2+
* 1. Change the inconsistent appearance in all browsers (opinionated).
3+
* 2. Add typography inheritance in all browsers (opinionated).
44
*/
55

66
button,
77
input,
88
select,
99
textarea {
1010
background-color: transparent; /* 1 */
11-
border: 0 solid; /* 1 */
12-
border-radius: 0.25em; /* 1 */
13-
box-shadow: inset 0 0 0 1px WindowFrame; /* 1 */
11+
border: 1px solid WindowFrame; /* 1 */
1412
color: inherit; /* 1 */
15-
font-family: inherit; /* 2 */
16-
font-size: inherit; /* 2 */
17-
line-height: inherit; /* 2 */
13+
font: inherit; /* 2 */
1814
letter-spacing: inherit; /* 2 */
1915
padding: 0.25em 0.375em; /* 1 */
2016
}
17+
18+
/**
19+
* Change the inconsistent appearance in all browsers (opinionated).
20+
*/
21+
22+
select {
23+
-moz-appearance: none;
24+
-webkit-appearance: none;
25+
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E") no-repeat right center / 1em;
26+
border-radius: 0;
27+
padding-right: 1em;
28+
}
29+
30+
/**
31+
* Change the inconsistent appearance in IE (opinionated).
32+
*/
33+
34+
::-ms-expand {
35+
display: none;
36+
}
37+
38+
/**
39+
* Correct the inconsistent appearance in IE (opinionated).
40+
*/
41+
42+
:-ms-input-placeholder {
43+
color: rgba(0, 0, 0, 0.54);
44+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sanitize.css",
3-
"version": "9.0.0",
3+
"version": "10.0.0",
44
"description": "A best-practices CSS foundation",
55
"author": "Jonathan Neal <[email protected]>",
66
"contributors": [
@@ -15,12 +15,13 @@
1515
"style": "sanitize.css",
1616
"files": [
1717
"forms.css",
18+
"page.css",
1819
"sanitize.css",
1920
"typography.css"
2021
],
2122
"scripts": {
2223
"prepublishOnly": "npm test",
23-
"test": "stylelint forms.css sanitize.css typography.css"
24+
"test": "stylelint *.css"
2425
},
2526
"devDependencies": {
2627
"stylelint": "^10.0.1",

page.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Use a comfortable measure in all browsers (opinionated).
3+
*/
4+
5+
html {
6+
padding: 1em;
7+
}
8+
9+
@media (min-width: 34em) {
10+
html {
11+
padding: 1em calc(50% - 16em);
12+
}
13+
}
14+
15+
/**
16+
* Restrict sizing to the page width in all browsers (opinionated).
17+
*/
18+
19+
iframe,
20+
img,
21+
input,
22+
select,
23+
textarea {
24+
height: auto;
25+
max-width: 100%;
26+
}

sanitize.css

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ body {
5656

5757
/**
5858
* Correct the font size and margin on `h1` elements within `section` and
59-
* `article` contexts in Chrome, Firefox, and Safari.
59+
* `article` contexts in Chrome, Edge, Firefox, and Safari.
6060
*/
6161

6262
h1 {
@@ -68,25 +68,31 @@ h1 {
6868
* ========================================================================== */
6969

7070
/**
71-
* Remove the margin on nested lists in Chrome and Safari.
71+
* Remove the margin on nested lists in Chrome, Edge, IE, and Safari.
7272
*/
7373

7474
dl dl,
7575
dl ol,
7676
dl ul,
7777
ol dl,
78+
ul dl {
79+
margin: 0;
80+
}
81+
82+
/**
83+
* Remove the margin on nested lists in Edge 18- and IE.
84+
*/
85+
7886
ol ol,
7987
ol ul,
80-
ul dl,
8188
ul ol,
8289
ul ul {
83-
margin-block-start: 0;
84-
margin-block-end: 0;
90+
margin: 0;
8591
}
8692

8793
/**
8894
* 1. Add the correct sizing in Firefox.
89-
* 2. Show the overflow in Edge and IE.
95+
* 2. Show the overflow in Edge 18- and IE.
9096
*/
9197

9298
hr {
@@ -134,7 +140,7 @@ a {
134140
}
135141

136142
/**
137-
* Add the correct text decoration in Edge, IE, Opera, and Safari.
143+
* Add the correct text decoration in Edge 18-, IE, and Safari.
138144
*/
139145

140146
abbr[title] {
@@ -205,6 +211,14 @@ audio:not([controls]) {
205211
height: 0;
206212
}
207213

214+
/**
215+
* Remove the border on iframes in all browsers (opinionated).
216+
*/
217+
218+
iframe {
219+
border-style: none;
220+
}
221+
208222
/**
209223
* Remove the border on images within links in IE 10-.
210224
*/
@@ -255,7 +269,7 @@ select {
255269

256270
/**
257271
* 1. Show the overflow in IE.
258-
* 2. Remove the inheritance of text transform in Edge, Firefox, and IE.
272+
* 2. Remove the inheritance of text transform in Edge 18-, Firefox, and IE.
259273
*/
260274

261275
button {
@@ -275,23 +289,25 @@ button,
275289
}
276290

277291
/**
278-
* Correct the padding in Firefox.
292+
* 1. Change the inconsistent appearance in all browsers (opinionated).
293+
* 2. Correct the padding in Firefox.
279294
*/
280295

281296
fieldset {
282-
padding: 0.35em 0.75em 0.625em;
297+
border: 1px solid #a0a0a0; /* 1 */
298+
padding: 0.35em 0.75em 0.625em; /* 2 */
283299
}
284300

285301
/**
286-
* Show the overflow in Edge and IE.
302+
* Show the overflow in Edge 18- and IE.
287303
*/
288304

289305
input {
290306
overflow: visible;
291307
}
292308

293309
/**
294-
* 1. Correct the text wrapping in Edge and IE.
310+
* 1. Correct the text wrapping in Edge 18- and IE.
295311
* 2. Correct the color inheritance from `fieldset` elements in IE.
296312
*/
297313

@@ -303,8 +319,8 @@ legend {
303319
}
304320

305321
/**
306-
* 1. Add the correct display in Edge and IE.
307-
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
322+
* 1. Add the correct display in Edge 18- and IE.
323+
* 2. Add the correct vertical alignment in Chrome, Edge, and Firefox.
308324
*/
309325

310326
progress {
@@ -342,7 +358,7 @@ textarea {
342358
}
343359

344360
/**
345-
* 1. Correct the odd appearance in Chrome and Safari.
361+
* 1. Correct the odd appearance in Chrome, Edge, and Safari.
346362
* 2. Correct the outline style in Safari.
347363
*/
348364

@@ -370,7 +386,7 @@ textarea {
370386
}
371387

372388
/**
373-
* Remove the inner padding in Chrome and Safari on macOS.
389+
* Remove the inner padding in Chrome, Edge, and Safari on macOS.
374390
*/
375391

376392
::-webkit-search-decoration {
@@ -416,15 +432,15 @@ textarea {
416432
* ========================================================================== */
417433

418434
/*
419-
* Add the correct display in Edge and IE.
435+
* Add the correct display in Edge 18- and IE.
420436
*/
421437

422438
details {
423439
display: block;
424440
}
425441

426442
/*
427-
* Add the correct styles in Edge, IE, and Safari.
443+
* Add the correct styles in Edge 18-, IE, and Safari.
428444
*/
429445

430446
dialog {

0 commit comments

Comments
 (0)