css-preflight 2.0.0 → 2.0.2

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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023-2025 Brett Wood
3
+ Copyright (c) 2023-2026 Brett Wood
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
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": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "CSS browser reset based on Tailwind's preflight, with optional enhancements.",
@@ -13,7 +13,11 @@
13
13
  "homepage": "https://github.com/woodbrettm/css-preflight",
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "https://github.com/woodbrettm/css-preflight"
16
+ "url": "git+https://github.com/woodbrettm/css-preflight",
17
+ "directory": "package"
18
+ },
19
+ "publishConfig": {
20
+ "provenance": true
17
21
  },
18
22
  "keywords": [
19
23
  "css",
@@ -23,10 +27,11 @@
23
27
  "normalizer",
24
28
  "browser"
25
29
  ],
26
- "main": "./styles/preflight.css",
27
- "style": "./styles/preflight.css",
28
30
  "exports": {
29
- ".": "./styles/preflight.css",
31
+ ".": {
32
+ "types": "./index.d.ts",
33
+ "default": "./styles/preflight.css"
34
+ },
30
35
  "./preflight.css": "./styles/preflight.css",
31
36
  "./font-mono.css": "./styles/font-mono.css",
32
37
  "./font-sans-serif.css": "./styles/font-sans-serif.css",
@@ -41,20 +46,7 @@
41
46
  "LICENSE_TAILWIND.md",
42
47
  "styles",
43
48
  "package.json",
44
- "README.md"
45
- ],
46
- "devDependencies": {
47
- "@changesets/cli": "2.29.5",
48
- "prettier": "3.6.2",
49
- "vite": "7.0.4",
50
- "eslint": "9.31.0",
51
- "@eslint/css": "0.10.0"
52
- },
53
- "scripts": {
54
- "changeset:version": "changeset version",
55
- "changeset:add": "changeset",
56
- "changeset:release": "changeset publish",
57
- "dev": "vite dev --config \"./playground/vite.config.js\"",
58
- "lint:css": "eslint \"./styles/**\""
59
- }
49
+ "README.md",
50
+ "index.d.ts"
51
+ ]
60
52
  }
@@ -1,24 +0,0 @@
1
- > The below copyright applies to `./styles/preflight.css` as it's derived directly
2
- > from Tailwind's preflight css.
3
-
4
- MIT License
5
-
6
- Copyright (c) Tailwind Labs, Inc.
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in all
16
- copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
- SOFTWARE.
package/README.md DELETED
@@ -1,174 +0,0 @@
1
- # CSS Preflight
2
-
3
- This is a CSS browser reset based on Tailwind's preflight, optimized for
4
- non-Tailwind projects. Optional enhancements like smooth scrolling and
5
- other utilities are also provided.
6
-
7
- ## Differences to Tailwind's Preflight
8
-
9
- The following adjustments have been made to to the preflight:
10
-
11
- 1. Tailwind-specific CSS variables and styling removed.
12
- 2. Two Tailwind `font-family` defaults have been removed from the
13
- preflight in favor of optional imports. One was setting the
14
- default font stack for the overall html document, and the other
15
- was setting monospace fonts for html elements like `code`.
16
-
17
- #### Why Font Family Defaults Removed
18
-
19
- Font stacks are a rapidly evolving space at the moment, and the use of
20
- system fonts is becoming more common, such as in Tailwind's
21
- preflight. However, the use of `system-ui` and similar values for the `font-family`
22
- property can be problematic. They not only depend on the OS version,
23
- but on the language settings of the OS as well, which can be unpredictable,
24
- according to the following article: https://infinnie.github.io/blog/2017/systemui.html.
25
-
26
- Granted, this is an older article, but as a precaution, `font-family` defaults
27
- have been moved to optional imports with possible system fonts being manually
28
- specified over the usage of `system-ui`, `monospace-ui`, etc.
29
-
30
- ## Installation
31
-
32
- ```bash
33
- #pnpm
34
- pnpm add css-preflight
35
-
36
- #npm
37
- npm install css-preflight
38
- ```
39
-
40
- ## Typical Usage
41
-
42
- Note this setup doesn't contain any defaults for the main font. Those are
43
- available as optional imports.
44
-
45
- ```javascript
46
- // main preflight
47
- // import "css-preflight" does the same.
48
- import "css-preflight/preflight.css";
49
-
50
- // Sets default fonts for html elements that use monospace fonts
51
- // Unnecessary to use this if wanting to set your own monospace fonts
52
- import "css-preflight/mono-elements.css";
53
- ```
54
-
55
- For fastest performance, it's recommended to have the css directly
56
- injected into the html as a `<style>` tag, along with any other critical
57
- css applying to above-the-fold content. Avoid putting the `<style>` tag
58
- inside `<head>` as invalid css can break processing of other elements
59
- inside `<head>`.
60
-
61
- ```html
62
- <head></head>
63
- <body>
64
- <style>
65
- <!-- Inject here -->
66
- </style>
67
- <!-- rest of html -->
68
- </body>
69
- ```
70
-
71
- Reminder to set emoji font fallbacks when defining your own
72
- font stacks:
73
-
74
- ```css
75
- :root,
76
- :host {
77
- font-family:
78
- /* Your fonts here */
79
- /* then do: */
80
- sans-serif,
81
- /* or serif, or monospace, etc. */ "Apple Color Emoji",
82
- "Segoe UI Emoji",
83
- "Segoe UI Symbol",
84
- "Noto Color Emoji";
85
- }
86
- ```
87
-
88
- ## Package Exports
89
-
90
- ### Main Preflight
91
-
92
- The main Tailwind-derived CSS reset.
93
-
94
- #### Bare Import
95
-
96
- ```javascript
97
- import "css-preflight"; // styles/preflight.css
98
- ```
99
-
100
- #### Named Import
101
-
102
- ```javascript
103
- import "css-preflight/preflight.css"; // styles/preflight.css
104
- ```
105
-
106
- ### Default Main Fonts
107
-
108
- Sets a default main font for the document (body text, headings, etc.) Only applies these
109
- to `:root` and `:host`, to be inherited by other elements. Useful in development when
110
- no main font has been chosen for the design yet, or for simple testing purposes.
111
-
112
- #### Mono
113
-
114
- ```javascript
115
- import "css-preflight/font-mono.css";
116
- ```
117
-
118
- #### Sans Serif
119
-
120
- ```javascript
121
- import "css-preflight/font-sans-serif.css";
122
- ```
123
-
124
- #### Serif
125
-
126
- ```javascript
127
- import "css-preflight/font-serif.css";
128
- ```
129
-
130
- ### Mono Elements
131
-
132
- Sets a default mono font stack for the `code`, `kbd`, `samp`, and `pre`
133
- html elements. Many design and branding systems don't include
134
- mono font guidelines so this option can be useful for those cases.
135
-
136
- ```javascript
137
- import "css-preflight/mono-elements.css";
138
- ```
139
-
140
- ### Rem Same Px
141
-
142
- Sets `1 rem = 1px` at the root for easier design-dev handoff. This calculation is done
143
- using `%`, so if the user adjusts the browser font sizes, those will still affect the page
144
- for accessibility purposes.
145
-
146
- Can sometimes mess up dev environment error messages though (the error UI becomes very,
147
- very small). That can be fixed of course, but just an FYI.
148
-
149
- ```javascript
150
- import "css-preflight/rem-same-px.css"; // styles/rem-same-px.css
151
- ```
152
-
153
- ### Smooth Scroll
154
-
155
- Enables smooth scrolling to anchor points (e.g. #about). Disabled for `prefers-reduced-motion`.
156
-
157
- ```javascript
158
- import "css-preflight/smooth-scroll.css"; // styles/smooth-scroll.css
159
- ```
160
-
161
- ### Text Wrap Balance
162
-
163
- Adds `text-wrap: balance` on h1-h6 and blockquote. Helps prevent single hanging words on
164
- heading newlines.
165
-
166
- ```javascript
167
- import "css-preflight/text-wrap-balance.css"; // styles/text-wrap-balance.css
168
- ```
169
-
170
- ## License
171
-
172
- The repo falls under MIT licensing, contained in the LICENSE.md file.
173
- Usage of the `preflight.css` file is also subject to Tailwind's licensing (MIT), which is included
174
- in the repo for reference.