@jmlweb/postcss-config 0.0.0 → 0.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/CHANGELOG.md +13 -0
- package/README.md +106 -19
- package/package.json +5 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @jmlweb/postcss-config
|
|
2
|
+
|
|
3
|
+
## 0.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 21918eb: Standardize repository field format to object format across all packages and configure syncpack to preserve it.
|
|
8
|
+
|
|
9
|
+
## 0.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2208f74: Standardize repository field format to object format across all packages and configure syncpack to preserve it.
|
package/README.md
CHANGED
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
> PostCSS configuration for Tailwind CSS projects. Includes Tailwind CSS and Autoprefixer plugins with sensible defaults.
|
|
8
8
|
|
|
9
|
-
## Features
|
|
9
|
+
## ✨ Features
|
|
10
10
|
|
|
11
|
-
- Tailwind CSS
|
|
12
|
-
- Autoprefixer
|
|
13
|
-
- Zero
|
|
14
|
-
-
|
|
11
|
+
- 🎨 **Tailwind CSS**: Utility-first CSS framework integration
|
|
12
|
+
- 🔧 **Autoprefixer**: Automatic vendor prefixes for cross-browser compatibility
|
|
13
|
+
- ⚡ **Zero Config**: Works out of the box with sensible defaults
|
|
14
|
+
- 📦 **PostCSS 8+**: Compatible with the latest PostCSS version
|
|
15
15
|
|
|
16
|
-
## Installation
|
|
16
|
+
## 📦 Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
npm install --save-dev @jmlweb/postcss-config postcss tailwindcss autoprefixer
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
## Quick Start
|
|
22
|
+
## 🚀 Quick Start
|
|
23
23
|
|
|
24
24
|
### Option 1: Using `postcss.config.js` (Recommended)
|
|
25
25
|
|
|
@@ -44,7 +44,41 @@ import config from '@jmlweb/postcss-config';
|
|
|
44
44
|
export default config;
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## 💡 Examples
|
|
48
|
+
|
|
49
|
+
### Basic Tailwind CSS Project
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
// postcss.config.js
|
|
53
|
+
export { default } from '@jmlweb/postcss-config';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
/* src/styles.css */
|
|
58
|
+
@tailwind base;
|
|
59
|
+
@tailwind components;
|
|
60
|
+
@tailwind utilities;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### With Vite
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
// postcss.config.js
|
|
67
|
+
export { default } from '@jmlweb/postcss-config';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Vite automatically detects the PostCSS config.
|
|
71
|
+
|
|
72
|
+
### With Next.js
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
// postcss.config.js
|
|
76
|
+
module.exports = require('@jmlweb/postcss-config').default;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Next.js uses CommonJS by default for PostCSS config.
|
|
80
|
+
|
|
81
|
+
## 📋 Configuration Details
|
|
48
82
|
|
|
49
83
|
This package provides a PostCSS configuration with the following plugins:
|
|
50
84
|
|
|
@@ -53,10 +87,30 @@ This package provides a PostCSS configuration with the following plugins:
|
|
|
53
87
|
| `tailwindcss` | Utility-first CSS framework |
|
|
54
88
|
| `autoprefixer` | Adds vendor prefixes to CSS rules |
|
|
55
89
|
|
|
56
|
-
|
|
90
|
+
### Plugin Order
|
|
91
|
+
|
|
92
|
+
Plugins are applied in the following order:
|
|
93
|
+
|
|
94
|
+
1. **Tailwind CSS** - Processes Tailwind directives and utilities
|
|
95
|
+
2. **Autoprefixer** - Adds vendor prefixes to the generated CSS
|
|
96
|
+
|
|
97
|
+
## 🎯 When to Use
|
|
98
|
+
|
|
99
|
+
Use this configuration when you want:
|
|
100
|
+
|
|
101
|
+
- ✅ Tailwind CSS with automatic vendor prefixing
|
|
102
|
+
- ✅ Consistent PostCSS setup across projects
|
|
103
|
+
- ✅ Zero-configuration Tailwind CSS integration
|
|
104
|
+
- ✅ Modern CSS with cross-browser compatibility
|
|
105
|
+
|
|
106
|
+
**For projects without Tailwind CSS**, you may want to create a custom PostCSS config with only the plugins you need.
|
|
107
|
+
|
|
108
|
+
## 🔧 Extending the Configuration
|
|
57
109
|
|
|
58
110
|
You can extend this config for project-specific needs:
|
|
59
111
|
|
|
112
|
+
### Adding Additional Plugins
|
|
113
|
+
|
|
60
114
|
```javascript
|
|
61
115
|
// postcss.config.js
|
|
62
116
|
import config from '@jmlweb/postcss-config';
|
|
@@ -67,18 +121,56 @@ export default {
|
|
|
67
121
|
...config.plugins,
|
|
68
122
|
// Add additional plugins
|
|
69
123
|
'postcss-import': {},
|
|
124
|
+
'postcss-nesting': {},
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Custom Plugin Order
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
// postcss.config.js
|
|
133
|
+
import config from '@jmlweb/postcss-config';
|
|
134
|
+
|
|
135
|
+
export default {
|
|
136
|
+
plugins: {
|
|
137
|
+
'postcss-import': {},
|
|
138
|
+
...config.plugins,
|
|
139
|
+
cssnano: { preset: 'default' },
|
|
70
140
|
},
|
|
71
141
|
};
|
|
72
142
|
```
|
|
73
143
|
|
|
74
|
-
##
|
|
144
|
+
## 📝 Usage with Scripts
|
|
145
|
+
|
|
146
|
+
Add build scripts to your `package.json`:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"scripts": {
|
|
151
|
+
"build:css": "postcss src/styles.css -o dist/styles.css",
|
|
152
|
+
"watch:css": "postcss src/styles.css -o dist/styles.css --watch"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Then run:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm run build:css # Build CSS
|
|
161
|
+
npm run watch:css # Watch for changes
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Note**: Most bundlers (Vite, Next.js, Webpack) handle PostCSS automatically.
|
|
165
|
+
|
|
166
|
+
## 📋 Requirements
|
|
75
167
|
|
|
76
168
|
- **Node.js** >= 18.0.0
|
|
77
169
|
- **PostCSS** >= 8.0.0
|
|
78
170
|
- **Tailwind CSS** >= 3.0.0
|
|
79
171
|
- **Autoprefixer** >= 10.0.0
|
|
80
172
|
|
|
81
|
-
## Peer Dependencies
|
|
173
|
+
## 📦 Peer Dependencies
|
|
82
174
|
|
|
83
175
|
This package requires the following peer dependencies:
|
|
84
176
|
|
|
@@ -86,17 +178,12 @@ This package requires the following peer dependencies:
|
|
|
86
178
|
- `tailwindcss` (>= 3.0.0 or >= 4.0.0)
|
|
87
179
|
- `autoprefixer` (>= 10.0.0)
|
|
88
180
|
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
See real-world usage examples:
|
|
92
|
-
|
|
93
|
-
- [`example-react-typescript-app`](../../apps/example-react-typescript-app) - React TypeScript app with Tailwind CSS
|
|
94
|
-
|
|
95
|
-
## Related Packages
|
|
181
|
+
## 🔗 Related Packages
|
|
96
182
|
|
|
97
183
|
- [`@jmlweb/prettier-config-tailwind`](../prettier-config-tailwind) - Prettier config with Tailwind class sorting
|
|
98
184
|
- [`@jmlweb/eslint-config-react`](../eslint-config-react) - ESLint config for React projects
|
|
185
|
+
- [`@jmlweb/vite-config`](../vite-config) - Vite configuration for frontend projects
|
|
99
186
|
|
|
100
|
-
## License
|
|
187
|
+
## 📄 License
|
|
101
188
|
|
|
102
189
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmlweb/postcss-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "PostCSS configuration for jmlweb projects with Tailwind CSS and Autoprefixer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"author": "jmlweb",
|
|
34
34
|
"license": "MIT",
|
|
35
|
-
"repository":
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/jmlweb/tooling.git"
|
|
38
|
+
},
|
|
36
39
|
"bugs": "https://github.com/jmlweb/tooling/issues",
|
|
37
40
|
"homepage": "https://github.com/jmlweb/tooling/tree/main/packages/postcss-config#readme",
|
|
38
41
|
"engines": {
|