@kungal/ui-tokens 0.4.1 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tokens.css +18 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/ui-tokens",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "KunUI design tokens — framework-agnostic Tailwind v4 theme (semantic colors, radius, z-index, animations).",
5
5
  "type": "module",
6
6
  "keywords": [
package/src/tokens.css CHANGED
@@ -132,15 +132,25 @@
132
132
  --color-info-950: hsl(var(--info-950));
133
133
 
134
134
  /* Border radius — 5 buckets every KunUI component references.
135
- * Override by setting :root { --radius-kun-md: ... } in the consuming
136
- * app, or per-subtree via the render layer's config provider.
137
- * Tailwind v4 @theme auto-generates the utility classes:
138
- * rounded-kun-none / -sm / -md / -lg / -full
139
- * The framework-agnostic class map lives in @kungal/ui-core (kunRoundedClasses). */
135
+ *
136
+ * Each scalable bucket multiplies its base by --kun-radius-scale (default 1),
137
+ * so a single RUNTIME knob drives every KunUI corner at once, live and with no
138
+ * re-render:
139
+ * :root { --kun-radius-scale: 0 } → square corners everywhere
140
+ * :root { --kun-radius-scale: 1.5 } → 50% rounder everywhere
141
+ * This is the robust override path: --kun-radius-scale is a NEW consumer-owned
142
+ * variable the calc() reads, so it never fights Tailwind's own :root
143
+ * --radius-kun-* declarations (those win the cascade if you try to override
144
+ * them directly, which is the usual "my :root override does nothing" trap).
145
+ * `none` and `full` deliberately don't scale — a square stays square, a pill
146
+ * stays a pill.
147
+ *
148
+ * Tailwind v4 @theme auto-generates rounded-kun-none / -sm / -md / -lg / -full;
149
+ * the framework-agnostic class map lives in @kungal/ui-core (kunRoundedClasses). */
140
150
  --radius-kun-none: 0;
141
- --radius-kun-sm: 0.25rem;
142
- --radius-kun-md: 0.5rem;
143
- --radius-kun-lg: 0.75rem;
151
+ --radius-kun-sm: calc(0.25rem * var(--kun-radius-scale, 1));
152
+ --radius-kun-md: calc(0.5rem * var(--kun-radius-scale, 1));
153
+ --radius-kun-lg: calc(0.75rem * var(--kun-radius-scale, 1));
144
154
  --radius-kun-full: 9999px;
145
155
 
146
156
  /* z-index layering — floating UI must stack predictably so a popover