@jmlweb/postcss-config 0.0.1 → 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +106 -19
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @jmlweb/postcss-config
2
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
+
3
9
  ## 0.0.1
4
10
 
5
11
  ### Patch Changes
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 plugin for utility-first CSS
12
- - Autoprefixer for automatic vendor prefixes
13
- - Zero configuration needed
14
- - Works with PostCSS 8+
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
- ## Configuration
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
- ## Extending the Configuration
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
- ## Requirements
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
- ## Examples
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.1",
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",