@enablo/swirlcn-tokens 0.0.0-stage → 0.5.1
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 +42 -2
- package/package.json +32 -3
- package/src/generated/theme.css +1084 -0
- package/src/generated/tokens.d.ts +310 -0
- package/src/generated/tokens.js +1030 -0
- package/src/generated/tokens.json +608 -0
- package/src/generated/utilities.json +120 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
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,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @enablo/swirlcn-tokens
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Flip's Swirl design tokens compiled into a Tailwind CSS v4 theme. Entirely generated from
|
|
4
|
+
`@getflip/swirl-tokens` — nothing here is hand-written.
|
|
5
|
+
|
|
6
|
+
```css
|
|
7
|
+
@import "tailwindcss";
|
|
8
|
+
@import "@enablo/swirlcn-tokens/theme.css";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What it emits
|
|
12
|
+
|
|
13
|
+
`src/generated/theme.css` has two layers:
|
|
14
|
+
|
|
15
|
+
1. **Raw tokens.** All 301 Swirl tokens as `--s-*` custom properties, declared three times: on
|
|
16
|
+
`:root, .theme-light`, on `.theme-dark`, and inside a `prefers-color-scheme: dark` block guarded
|
|
17
|
+
by `:root:not(.theme-light)`. That last one is why "follow the OS" needs no JavaScript.
|
|
18
|
+
|
|
19
|
+
2. **An `@theme inline` block** mapping them onto Tailwind's namespaces. `inline` matters: without
|
|
20
|
+
it Tailwind copies the *resolved value* into each utility and the theme stops flipping at
|
|
21
|
+
runtime. With it you get `background-color: var(--s-action-primary-default)`.
|
|
22
|
+
|
|
23
|
+
Also exported: `tokens.json` and a typed `tokens.js` (`light`, `dark`, `tokenNames`) for anywhere
|
|
24
|
+
you need the values in JavaScript.
|
|
25
|
+
|
|
26
|
+
## Notable mapping decisions
|
|
27
|
+
|
|
28
|
+
- **Colours are collapsed by role.** Swirl splits one colour across `text-`/`icon-`/`border-`/
|
|
29
|
+
`surface-`. Where those share a value they become one Tailwind colour (`critical`); where they
|
|
30
|
+
genuinely diverge — only `warning` and `highlight` do — the surface value is exposed separately
|
|
31
|
+
(`surface-warning`). Verified against the token JSON, not assumed.
|
|
32
|
+
- **Radii are replaced wholesale**, since Swirl's 2/4/8/12/16/20px scale doesn't line up with
|
|
33
|
+
Tailwind's. Swirl's names are kept and `rounded-md`/`lg` alias `base`/`l`.
|
|
34
|
+
- **Spacing is left alone.** Swirl's scale is a 4px grid already present in Tailwind's defaults.
|
|
35
|
+
- **Only `text-2xl` differs** from Tailwind's type scale (1.75rem vs 1.5rem), but all six sizes are
|
|
36
|
+
declared so the paired line heights come from Swirl rather than Tailwind's ratio.
|
|
37
|
+
|
|
38
|
+
## Regenerating
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm --filter @enablo/swirlcn-tokens add -D @getflip/swirl-tokens@latest
|
|
42
|
+
pnpm tokens
|
|
43
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enablo/swirlcn-tokens",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Flip Swirl design tokens compiled for Tailwind CSS v4.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Enablo/swirlcn.git",
|
|
9
|
+
"directory": "packages/tokens"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"*.css"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./src/generated/tokens.js",
|
|
24
|
+
"./theme.css": "./src/generated/theme.css",
|
|
25
|
+
"./tokens.json": "./src/generated/tokens.json",
|
|
26
|
+
"./utilities.json": "./src/generated/utilities.json"
|
|
27
|
+
},
|
|
28
|
+
"types": "./src/generated/tokens.d.ts",
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@getflip/swirl-tokens": "^2.14.3"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "node scripts/generate.mjs"
|
|
34
|
+
}
|
|
6
35
|
}
|