css-preflight 1.0.0 → 1.1.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.
- package/README.md +7 -4
- package/package.json +6 -3
- package/styles/enhancements.css +0 -15
- package/styles/smooth-scroll.css +14 -0
package/README.md
CHANGED
|
@@ -50,14 +50,14 @@ import 'css-preflight'; // styles/preflight.css
|
|
|
50
50
|
import 'css-preflight/preflight'; // ALIAS: styles/preflight.css
|
|
51
51
|
|
|
52
52
|
import 'css-preflight/enhancements'; // styles/enhancements.css
|
|
53
|
-
|
|
54
|
-
import 'css-preflight/rem-same-px'; // styles/rem-same-px
|
|
53
|
+
import 'css-preflight/smooth-scroll'; // styles/smooth-scroll.css
|
|
54
|
+
import 'css-preflight/rem-same-px'; // styles/rem-same-px.css
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
#### Typical Setup
|
|
58
58
|
|
|
59
59
|
```javascript
|
|
60
|
-
import 'css-preflight
|
|
60
|
+
import 'css-preflight';
|
|
61
61
|
import 'css-preflight/enhancements';
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -71,9 +71,12 @@ Both are exactly the same.
|
|
|
71
71
|
|
|
72
72
|
These are small enhancements added to the main preflight:
|
|
73
73
|
|
|
74
|
-
- Enables smooth scrolling to anchor points (e.g. #about). Disabled for `prefers-reduced-motion`.
|
|
75
74
|
- Adds `text-wrap: balance` on h1-h6 and blockquote. Helps prevent hanging words on newlines.
|
|
76
75
|
|
|
76
|
+
### Smooth Scroll
|
|
77
|
+
|
|
78
|
+
Enables smooth scrolling to anchor points (e.g. #about). Disabled for `prefers-reduced-motion`.
|
|
79
|
+
|
|
77
80
|
### Rem Same Px
|
|
78
81
|
|
|
79
82
|
Sets rem equal to 1px at the root for easier design-dev handoff. This calculation is done
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "css-preflight",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "CSS browser reset based on Tailwind's preflight, with optional enhancements.",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
".": "./styles/preflight.css",
|
|
30
30
|
"./preflight": "./styles/preflight.css",
|
|
31
31
|
"./enhancements": "./styles/enhancements.css",
|
|
32
|
+
"./smooth-scroll": "./styles/smooth-scroll.css",
|
|
32
33
|
"./rem-same-px": "./styles/rem-same-px.css"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
@@ -41,10 +42,12 @@
|
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@changesets/cli": "2.27.1",
|
|
43
44
|
"stylelint": "15.11.0",
|
|
44
|
-
"stylelint-config-standard": "34.0.0"
|
|
45
|
+
"stylelint-config-standard": "34.0.0",
|
|
46
|
+
"prettier": "3.1.0"
|
|
45
47
|
},
|
|
46
48
|
"scripts": {
|
|
47
|
-
"
|
|
49
|
+
"stylelint": "stylelint \"./styles/*.css\"",
|
|
50
|
+
"prettier-check": "prettier --check ./styles/*.css",
|
|
48
51
|
"release": "changeset publish"
|
|
49
52
|
}
|
|
50
53
|
}
|
package/styles/enhancements.css
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Adds smooth scrolling when a user is navigated to an
|
|
3
|
-
anchor on a page.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
:root {
|
|
7
|
-
scroll-behavior: smooth;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@media (prefers-reduced-motion) {
|
|
11
|
-
:root {
|
|
12
|
-
scroll-behavior: auto;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
1
|
/*
|
|
17
2
|
Helps prevent single words on a newline,
|
|
18
3
|
which can make a title seem unbalanced.
|