tunewind 0.0.0-stage → 0.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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +112 -2
- package/dist/index.cjs +1638 -0
- package/dist/index.d.cts +123 -0
- package/dist/index.d.mts +123 -0
- package/dist/index.mjs +1614 -0
- package/package.json +84 -3
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Twisuki
|
|
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
CHANGED
|
@@ -1,3 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Tunewind
|
|
4
|
+
|
|
5
|
+
Bring design system standards to Tailwind !
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/tunewind)
|
|
8
|
+
[](https://github.com/Twisuki/tunewind/actions)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
|
|
15
|
+
### 1. Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add -D tunewind postcss tailwindcss @tailwindcss/postcss
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Not published to npm yet; link the repository locally until it is.
|
|
22
|
+
|
|
23
|
+
### 2. PostCSS plugins
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import tailwindcss from "@tailwindcss/postcss"
|
|
27
|
+
import { tunewind } from "tunewind"
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
plugins: [
|
|
31
|
+
tunewind.preprocess(),
|
|
32
|
+
tailwindcss(),
|
|
33
|
+
tunewind.postprocess(),
|
|
34
|
+
],
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Keep the order. Tunewind runs before and after Tailwind; swapped around, the build still passes but the output comes out without the theme.
|
|
39
|
+
|
|
40
|
+
### 3. Entry CSS
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
@import "tailwindcss";
|
|
44
|
+
@tunewind;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 4. Config
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { defineConfig } from "tunewind"
|
|
51
|
+
|
|
52
|
+
export default defineConfig({
|
|
53
|
+
theme: {
|
|
54
|
+
// color names or alias
|
|
55
|
+
palette: {
|
|
56
|
+
primary: "sky",
|
|
57
|
+
accent: "violet",
|
|
58
|
+
},
|
|
59
|
+
// allowed shades and alias
|
|
60
|
+
shade: {
|
|
61
|
+
default: 600,
|
|
62
|
+
subtle: 300,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
// allowed numbers
|
|
67
|
+
max: 8,
|
|
68
|
+
// allowed units and suffix
|
|
69
|
+
units: {
|
|
70
|
+
default: "4px",
|
|
71
|
+
x: "1px",
|
|
72
|
+
r: "1rem",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
// enforcement and escape hatches
|
|
76
|
+
strict: "bypass",
|
|
77
|
+
// visibility of the dropped nodes
|
|
78
|
+
diagnostics: "warn",
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 5. Usage
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<article class="w-8r rounded-lg border border-primary bg-white p-4">
|
|
86
|
+
<!-- sizes: w-8r is 8 * units.r(1rem) -->
|
|
87
|
+
<h2 class="text-sm font-semibold text-primary">Tunewind</h2>
|
|
88
|
+
<p class="mt-2 text-sm text-primary-subtle">Bring design system standards to Tailwind !</p>
|
|
89
|
+
<!-- colors: text-primary-subtle is the shade.subtle(300) of palette.primary(sky) -->
|
|
90
|
+
</article>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This is the difference Tunewind makes: a class exists only if the config allows it.
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<article class="w-[720px] border border-sky p-[13px]">
|
|
97
|
+
<!-- dropped: arbitrary values are off under strict -->
|
|
98
|
+
<h2 class="text-sky">Tunewind</h2>
|
|
99
|
+
<!-- dropped: sky is not named in palette -->
|
|
100
|
+
</article>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Documentation
|
|
104
|
+
|
|
105
|
+
Full documentation: <https://tune.twis.uk/>.
|
|
106
|
+
|
|
107
|
+
## Changelog
|
|
108
|
+
|
|
109
|
+
[CHANGELOG.md](./CHANGELOG.md)
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
[MIT](./LICENSE)
|