@gustcss/postcss 0.1.0 → 0.2.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/LICENSE +21 -0
- package/README.md +109 -0
- package/package.json +5 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kumasuke
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# @gustcss/postcss
|
|
2
|
+
|
|
3
|
+
PostCSS plugin for [GustCSS](https://www.npmjs.com/package/gustcss) - Lightning-fast CSS utility generator.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install gustcss @gustcss/postcss postcss
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Basic Setup
|
|
14
|
+
|
|
15
|
+
In your `postcss.config.js`:
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
module.exports = {
|
|
19
|
+
plugins: [
|
|
20
|
+
require('@gustcss/postcss')({
|
|
21
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
22
|
+
}),
|
|
23
|
+
],
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### In Your CSS
|
|
28
|
+
|
|
29
|
+
Add the `@gustcss` directive in your CSS file:
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@gustcss;
|
|
33
|
+
|
|
34
|
+
/* Your custom styles */
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The plugin will scan your source files and generate utility classes on-demand.
|
|
38
|
+
|
|
39
|
+
### Configuration
|
|
40
|
+
|
|
41
|
+
#### Using Plugin Options
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
module.exports = {
|
|
45
|
+
plugins: [
|
|
46
|
+
require('@gustcss/postcss')({
|
|
47
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
48
|
+
config: './gustcss.config.json', // Optional: path to config file
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Using Config File
|
|
55
|
+
|
|
56
|
+
Create `gustcss.config.json` in your project root:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"content": ["./src/**/*.{js,ts,jsx,tsx}"],
|
|
61
|
+
"output": "dist/utility.css",
|
|
62
|
+
"darkMode": "class",
|
|
63
|
+
"theme": {
|
|
64
|
+
"extend": {
|
|
65
|
+
"colors": {
|
|
66
|
+
"brand": "#3B82F6"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## How It Works
|
|
74
|
+
|
|
75
|
+
1. The plugin scans files specified in the `content` array
|
|
76
|
+
2. Extracts utility class names from your code
|
|
77
|
+
3. Generates CSS for those utilities on-demand
|
|
78
|
+
4. Injects the generated CSS into your build
|
|
79
|
+
|
|
80
|
+
## Example
|
|
81
|
+
|
|
82
|
+
**Input** (your HTML/JSX):
|
|
83
|
+
```jsx
|
|
84
|
+
<div className="p-4 bg-blue-500 text-white rounded-lg">
|
|
85
|
+
Hello GustCSS!
|
|
86
|
+
</div>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Output** (generated CSS):
|
|
90
|
+
```css
|
|
91
|
+
.p-4 { padding: 1rem; }
|
|
92
|
+
.bg-blue-500 { background-color: #3b82f6; }
|
|
93
|
+
.text-white { color: #ffffff; }
|
|
94
|
+
.rounded-lg { border-radius: 0.5rem; }
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Requirements
|
|
98
|
+
|
|
99
|
+
- Node.js >= 18.0.0
|
|
100
|
+
- PostCSS ^8.0.0
|
|
101
|
+
|
|
102
|
+
## Related Packages
|
|
103
|
+
|
|
104
|
+
- [gustcss](https://www.npmjs.com/package/gustcss) - CLI tool
|
|
105
|
+
- [@gustcss/vite](https://www.npmjs.com/package/@gustcss/vite) - Vite plugin
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustcss/postcss",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "PostCSS plugin for
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "PostCSS plugin for GustCSS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"files": [
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"gustcss": "^0.
|
|
15
|
+
"gustcss": "^0.2.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"postcss": "^8.0.0"
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT"
|
|
20
21
|
}
|