@charstudios/pallet 0.1.0 → 0.3.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.
@@ -0,0 +1,339 @@
1
+ /*
2
+ * Toon variant skin.
3
+ *
4
+ * Cel-shaded / neo-brutalist: moderate radius, no soft shadows, and a thick
5
+ * bottom "lip" whose color is auto-derived from each surface's fill
6
+ * (`--toon-fill`) via color-mix — slightly darker than the background.
7
+ */
8
+
9
+ @layer pallet-variants {
10
+ [data-pallet-variant="toon"] {
11
+ --toon-radius: var(--radius-lg);
12
+ --toon-radius-sm: var(--radius-md);
13
+ --toon-outline: 1.5px;
14
+ --toon-lip: 3.5px;
15
+ /* Default fill used when a slot does not override --toon-fill */
16
+ --toon-fill: var(--card);
17
+ }
18
+
19
+ /* Shared toon chunk: outline + thick auto-darkened bottom border, no shadow.
20
+ Lip/edge colors read --toon-fill on the element itself so overrides work. */
21
+ [data-pallet-variant="toon"] :is(
22
+ [data-slot="button"],
23
+ [data-slot="input"],
24
+ [data-slot="textarea"],
25
+ [data-slot="select-trigger"],
26
+ [data-slot="native-select"],
27
+ [data-slot="native-select-wrapper"],
28
+ [data-slot="combobox-trigger"],
29
+ [data-slot="combobox-chip"],
30
+ [data-slot="combobox-chip-input"],
31
+ [data-slot="command-input"],
32
+ [data-slot="input-otp"],
33
+ [data-slot="input-otp-slot"],
34
+ [data-slot="input-group"],
35
+ [data-slot="input-group-control"],
36
+ [data-slot="sidebar-input"],
37
+ [data-slot="toggle"],
38
+ [data-slot="toggle-group"],
39
+ [data-slot="toggle-group-item"],
40
+ [data-slot="pagination-link"],
41
+ [data-slot="button-group"],
42
+ [data-slot="input-group-button"],
43
+ [data-slot="carousel-previous"],
44
+ [data-slot="carousel-next"],
45
+ [data-slot="sidebar-trigger"],
46
+ [data-slot="sidebar-menu-button"],
47
+ [data-slot="sidebar-menu-sub-button"],
48
+ [data-slot="sidebar-group-action"],
49
+ [data-slot="sidebar-menu-action"],
50
+ [data-slot="badge"],
51
+ [data-slot="kbd"],
52
+ [data-slot="card"],
53
+ [data-slot="alert"],
54
+ [data-slot="accordion-item"],
55
+ [data-slot="tabs-list"],
56
+ [data-slot="tabs-trigger"],
57
+ [data-slot="table-container"],
58
+ [data-slot="item"],
59
+ [data-slot="item-group"],
60
+ [data-slot="empty"],
61
+ [data-slot="field-set"],
62
+ [data-slot="sidebar"],
63
+ [data-slot="sidebar-container"],
64
+ [data-slot="sidebar-inner"],
65
+ [data-slot="sidebar-group"],
66
+ [data-slot="carousel"],
67
+ [data-slot="chart"],
68
+ [data-slot="menubar"],
69
+ [data-slot="navigation-menu-viewport"],
70
+ [data-slot="breadcrumb"],
71
+ [data-slot="pagination"],
72
+ [data-slot="scroll-area"],
73
+ [data-slot="calendar"],
74
+ [data-slot="popover-content"],
75
+ [data-slot="dropdown-menu-content"],
76
+ [data-slot="dropdown-menu-sub-content"],
77
+ [data-slot="context-menu-content"],
78
+ [data-slot="context-menu-sub-content"],
79
+ [data-slot="menubar-content"],
80
+ [data-slot="menubar-sub-content"],
81
+ [data-slot="select-content"],
82
+ [data-slot="combobox-content"],
83
+ [data-slot="combobox-list"],
84
+ [data-slot="command"],
85
+ [data-slot="command-list"],
86
+ [data-slot="hover-card-content"],
87
+ [data-slot="tooltip-content"],
88
+ [data-slot="navigation-menu-content"],
89
+ [data-slot="dialog-content"],
90
+ [data-slot="alert-dialog-content"],
91
+ [data-slot="sheet-content"],
92
+ [data-slot="drawer-content"]
93
+ ) {
94
+ border-style: solid;
95
+ border-width: var(--toon-outline);
96
+ border-bottom-width: var(--toon-lip);
97
+ border-color: color-mix(in oklch, var(--toon-fill) 42%, var(--foreground));
98
+ border-bottom-color: color-mix(in oklch, var(--toon-fill) 68%, black);
99
+ border-radius: var(--toon-radius);
100
+ box-shadow: none !important;
101
+ filter: none;
102
+ text-shadow: none;
103
+ }
104
+
105
+ /* ── Fill tokens (lip color is derived from these) ─────────────────────── */
106
+ [data-pallet-variant="toon"] :is(
107
+ [data-slot="card"],
108
+ [data-slot="alert"],
109
+ [data-slot="item"],
110
+ [data-slot="item-group"],
111
+ [data-slot="empty"],
112
+ [data-slot="accordion-item"],
113
+ [data-slot="table-container"],
114
+ [data-slot="field-set"],
115
+ [data-slot="calendar"],
116
+ [data-slot="chart"],
117
+ [data-slot="carousel"]
118
+ ) {
119
+ --toon-fill: var(--card);
120
+ }
121
+
122
+ [data-pallet-variant="toon"] :is(
123
+ [data-slot="popover-content"],
124
+ [data-slot="dropdown-menu-content"],
125
+ [data-slot="dropdown-menu-sub-content"],
126
+ [data-slot="context-menu-content"],
127
+ [data-slot="context-menu-sub-content"],
128
+ [data-slot="menubar-content"],
129
+ [data-slot="menubar-sub-content"],
130
+ [data-slot="select-content"],
131
+ [data-slot="combobox-content"],
132
+ [data-slot="combobox-list"],
133
+ [data-slot="command"],
134
+ [data-slot="command-list"],
135
+ [data-slot="hover-card-content"],
136
+ [data-slot="tooltip-content"],
137
+ [data-slot="navigation-menu-content"],
138
+ [data-slot="dialog-content"],
139
+ [data-slot="alert-dialog-content"],
140
+ [data-slot="sheet-content"],
141
+ [data-slot="drawer-content"]
142
+ ) {
143
+ --toon-fill: var(--popover);
144
+ }
145
+
146
+ [data-pallet-variant="toon"] :is(
147
+ [data-slot="input"],
148
+ [data-slot="textarea"],
149
+ [data-slot="select-trigger"],
150
+ [data-slot="native-select"],
151
+ [data-slot="native-select-wrapper"],
152
+ [data-slot="combobox-trigger"],
153
+ [data-slot="combobox-chip-input"],
154
+ [data-slot="command-input"],
155
+ [data-slot="input-otp"],
156
+ [data-slot="input-otp-slot"],
157
+ [data-slot="input-group"],
158
+ [data-slot="input-group-control"],
159
+ [data-slot="sidebar-input"]
160
+ ) {
161
+ --toon-fill: var(--background);
162
+ background-color: var(--background);
163
+ }
164
+
165
+ [data-pallet-variant="toon"] :is(
166
+ [data-slot="button"],
167
+ [data-slot="input-group-button"],
168
+ [data-slot="carousel-previous"],
169
+ [data-slot="carousel-next"],
170
+ [data-slot="pagination-link"]
171
+ ) {
172
+ /* Default / primary-looking controls — lip darkens the primary fill */
173
+ --toon-fill: var(--primary);
174
+ }
175
+
176
+ /* Non-primary button variants: lip tracks the light surface fill instead */
177
+ [data-pallet-variant="toon"] [data-slot="button"]:is(
178
+ [data-variant="outline"],
179
+ [data-variant="secondary"],
180
+ [data-variant="ghost"],
181
+ [class*="bg-secondary"],
182
+ [class*="bg-background"]
183
+ ) {
184
+ --toon-fill: var(--background);
185
+ }
186
+
187
+ [data-pallet-variant="toon"] [data-slot="button"]:is(
188
+ [data-variant="destructive"],
189
+ [class*="bg-destructive"]
190
+ ) {
191
+ --toon-fill: var(--destructive);
192
+ }
193
+
194
+ [data-pallet-variant="toon"] :is(
195
+ [data-slot="toggle"],
196
+ [data-slot="toggle-group-item"],
197
+ [data-slot="badge"],
198
+ [data-slot="kbd"],
199
+ [data-slot="tabs-list"],
200
+ [data-slot="tabs-trigger"],
201
+ [data-slot="combobox-chip"]
202
+ ) {
203
+ --toon-fill: var(--secondary);
204
+ }
205
+
206
+ [data-pallet-variant="toon"] :is(
207
+ [data-slot="sidebar"],
208
+ [data-slot="sidebar-container"],
209
+ [data-slot="sidebar-inner"],
210
+ [data-slot="sidebar-group"],
211
+ [data-slot="menubar"],
212
+ [data-slot="navigation-menu-viewport"]
213
+ ) {
214
+ --toon-fill: var(--sidebar);
215
+ }
216
+
217
+ [data-pallet-variant="toon"] :is(
218
+ [data-slot="sidebar-menu-button"],
219
+ [data-slot="sidebar-menu-sub-button"],
220
+ [data-slot="sidebar-trigger"],
221
+ [data-slot="sidebar-group-action"],
222
+ [data-slot="sidebar-menu-action"]
223
+ ) {
224
+ --toon-fill: var(--sidebar);
225
+ }
226
+
227
+ /* Active / on states: lip tracks the primary fill */
228
+ [data-pallet-variant="toon"] :is(
229
+ [data-slot="sidebar-menu-button"],
230
+ [data-slot="tabs-trigger"],
231
+ [data-slot="toggle"],
232
+ [data-slot="toggle-group-item"],
233
+ [data-slot="pagination-link"]
234
+ ):is([data-active="true"], [data-state="on"], [data-state="active"]) {
235
+ --toon-fill: var(--primary);
236
+ }
237
+
238
+ /* ── Sizing tweaks ─────────────────────────────────────────────────────── */
239
+ [data-pallet-variant="toon"] :is(
240
+ [data-slot="badge"],
241
+ [data-slot="kbd"],
242
+ [data-slot="avatar-badge"],
243
+ [data-slot="checkbox"],
244
+ [data-slot="input-otp-slot"]
245
+ ) {
246
+ border-radius: var(--toon-radius-sm);
247
+ --toon-lip: 2.5px;
248
+ }
249
+
250
+ [data-pallet-variant="toon"] :is(
251
+ [data-slot="checkbox"],
252
+ [data-slot="radio-group-item"],
253
+ [data-slot="switch"],
254
+ [data-slot="slider-track"],
255
+ [data-slot="progress"],
256
+ [data-slot="avatar"],
257
+ [data-slot="avatar-fallback"]
258
+ ) {
259
+ --toon-fill: var(--background);
260
+ border-style: solid;
261
+ border-width: var(--toon-outline);
262
+ border-bottom-width: var(--toon-lip);
263
+ border-color: color-mix(in oklch, var(--toon-fill) 42%, var(--foreground));
264
+ border-bottom-color: color-mix(in oklch, var(--toon-fill) 68%, black);
265
+ border-radius: var(--toon-radius-sm);
266
+ box-shadow: none !important;
267
+ }
268
+
269
+ [data-pallet-variant="toon"] [data-slot="switch"],
270
+ [data-pallet-variant="toon"] [data-slot="slider-track"],
271
+ [data-pallet-variant="toon"] [data-slot="progress"] {
272
+ border-radius: 9999px;
273
+ --toon-fill: var(--input);
274
+ }
275
+
276
+ [data-pallet-variant="toon"] [data-slot="switch"][data-state="checked"] {
277
+ --toon-fill: var(--primary);
278
+ border-color: color-mix(in oklch, var(--toon-fill) 42%, var(--foreground));
279
+ border-bottom-color: color-mix(in oklch, var(--toon-fill) 68%, black);
280
+ }
281
+
282
+ [data-pallet-variant="toon"] [data-slot="textarea"] {
283
+ border-radius: var(--radius-xl);
284
+ }
285
+
286
+ /* Press: sink the lip slightly for a tactile toon feel */
287
+ [data-pallet-variant="toon"] :is(
288
+ [data-slot="button"],
289
+ [data-slot="toggle"],
290
+ [data-slot="toggle-group-item"],
291
+ [data-slot="pagination-link"],
292
+ [data-slot="sidebar-menu-button"],
293
+ [data-slot="carousel-previous"],
294
+ [data-slot="carousel-next"]
295
+ ):active {
296
+ transform: translateY(1px);
297
+ border-bottom-width: 2px;
298
+ }
299
+
300
+ [data-pallet-variant="toon"] :is(
301
+ [data-slot="dropdown-menu-item"],
302
+ [data-slot="dropdown-menu-checkbox-item"],
303
+ [data-slot="dropdown-menu-radio-item"],
304
+ [data-slot="dropdown-menu-sub-trigger"],
305
+ [data-slot="context-menu-item"],
306
+ [data-slot="menubar-item"],
307
+ [data-slot="select-item"],
308
+ [data-slot="combobox-item"],
309
+ [data-slot="command-item"],
310
+ [data-slot="navigation-menu-link"]
311
+ ) {
312
+ border-radius: var(--toon-radius-sm);
313
+ box-shadow: none !important;
314
+ }
315
+
316
+ [data-pallet-variant="toon"] :is(
317
+ [data-slot="dialog-overlay"],
318
+ [data-slot="alert-dialog-overlay"],
319
+ [data-slot="sheet-overlay"],
320
+ [data-slot="drawer-overlay"]
321
+ ) {
322
+ background-color: color-mix(in oklch, var(--foreground) 45%, transparent);
323
+ backdrop-filter: none;
324
+ }
325
+
326
+ [data-pallet-variant="toon"] [data-slot="table-row"]:hover {
327
+ background-color: color-mix(in oklch, var(--muted) 80%, transparent);
328
+ }
329
+
330
+ [data-pallet-variant="toon"] :is(
331
+ [data-slot="separator"],
332
+ [data-slot="sidebar-separator"],
333
+ [data-slot="dropdown-menu-separator"],
334
+ [data-slot="command-separator"],
335
+ [data-slot="select-separator"]
336
+ ) {
337
+ background-color: color-mix(in oklch, var(--foreground) 18%, transparent);
338
+ }
339
+ }
package/package.json CHANGED
@@ -1,78 +1,79 @@
1
- {
2
- "name": "@charstudios/pallet",
3
- "version": "0.1.0",
4
- "description": "Runtime, hook-driven theming layer for shadcn/ui apps. Full control over colors, fonts, roundness, elevation, spacing and motion, with swappable visual variants.",
5
- "type": "module",
6
- "license": "MIT",
7
- "author": "Char Studios",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/Char-Studios/Pallet.git"
11
- },
12
- "bugs": {
13
- "url": "https://github.com/Char-Studios/Pallet/issues"
14
- },
15
- "homepage": "https://github.com/Char-Studios/Pallet#readme",
16
- "keywords": [
17
- "shadcn",
18
- "theme",
19
- "theming",
20
- "design-system",
21
- "tailwind",
22
- "react",
23
- "nextjs",
24
- "css-variables",
25
- "tokens"
26
- ],
27
- "sideEffects": [
28
- "**/*.css"
29
- ],
30
- "files": [
31
- "dist"
32
- ],
33
- "exports": {
34
- ".": {
35
- "types": "./dist/index.d.ts",
36
- "import": "./dist/index.js"
37
- },
38
- "./server": {
39
- "types": "./dist/server.d.ts",
40
- "import": "./dist/server.js"
41
- },
42
- "./presets": {
43
- "types": "./dist/presets/index.d.ts",
44
- "import": "./dist/presets/index.js"
45
- },
46
- "./styles": "./dist/styles/index.css",
47
- "./styles/flat": "./dist/styles/variant-flat.css",
48
- "./styles/launch": "./dist/styles/variant-launch.css",
49
- "./styles/base": "./dist/styles/base.css"
50
- },
51
- "main": "./dist/index.js",
52
- "module": "./dist/index.js",
53
- "types": "./dist/index.d.ts",
54
- "scripts": {
55
- "build": "tsup",
56
- "dev": "tsup --watch",
57
- "typecheck": "tsc --noEmit",
58
- "prepublishOnly": "npm run build"
59
- },
60
- "peerDependencies": {
61
- "react": ">=18",
62
- "react-dom": ">=18"
63
- },
64
- "devDependencies": {
65
- "@types/react": "^19",
66
- "@types/react-dom": "^19",
67
- "react": "^19",
68
- "react-dom": "^19",
69
- "tsup": "^8.5.0",
70
- "typescript": "^5.6.0"
71
- },
72
- "publishConfig": {
73
- "access": "public"
74
- },
75
- "engines": {
76
- "node": ">=18"
77
- }
78
- }
1
+ {
2
+ "name": "@charstudios/pallet",
3
+ "version": "0.3.0",
4
+ "description": "Runtime, hook-driven theming layer for shadcn/ui apps. Full control over colors, fonts, roundness, elevation, spacing and motion, with swappable visual variants.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Char Studios",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Char-Studios/Pallet.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/Char-Studios/Pallet/issues"
14
+ },
15
+ "homepage": "https://github.com/Char-Studios/Pallet#readme",
16
+ "keywords": [
17
+ "shadcn",
18
+ "theme",
19
+ "theming",
20
+ "design-system",
21
+ "tailwind",
22
+ "react",
23
+ "nextjs",
24
+ "css-variables",
25
+ "tokens"
26
+ ],
27
+ "sideEffects": [
28
+ "**/*.css"
29
+ ],
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ },
38
+ "./server": {
39
+ "types": "./dist/server.d.ts",
40
+ "import": "./dist/server.js"
41
+ },
42
+ "./presets": {
43
+ "types": "./dist/presets/index.d.ts",
44
+ "import": "./dist/presets/index.js"
45
+ },
46
+ "./styles": "./dist/styles/index.css",
47
+ "./styles/flat": "./dist/styles/variant-flat.css",
48
+ "./styles/toon": "./dist/styles/variant-toon.css",
49
+ "./styles/frosted": "./dist/styles/variant-frosted.css",
50
+ "./styles/base": "./dist/styles/base.css"
51
+ },
52
+ "main": "./dist/index.js",
53
+ "module": "./dist/index.js",
54
+ "types": "./dist/index.d.ts",
55
+ "scripts": {
56
+ "build": "tsup",
57
+ "dev": "tsup --watch",
58
+ "typecheck": "tsc --noEmit",
59
+ "prepublishOnly": "npm run build"
60
+ },
61
+ "peerDependencies": {
62
+ "react": ">=18",
63
+ "react-dom": ">=18"
64
+ },
65
+ "devDependencies": {
66
+ "@types/react": "^19",
67
+ "@types/react-dom": "^19",
68
+ "react": "^19",
69
+ "react-dom": "^19",
70
+ "tsup": "^8.5.0",
71
+ "typescript": "^5.6.0"
72
+ },
73
+ "publishConfig": {
74
+ "access": "public"
75
+ },
76
+ "engines": {
77
+ "node": ">=18"
78
+ }
79
+ }