@godxjp/ui 13.15.1 → 13.16.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.
@@ -1,7 +1,7 @@
1
1
  import { type AppDateFormat, type AppLocale, type AppTimeFormat, type AppTimezone } from "./types";
2
2
  import type { AppContextValue, AppProviderProp } from "../props/components/app.prop";
3
3
  export type { AppProviderProp, AppContextValue } from "../props/components/app.prop";
4
- export declare function AppProvider({ children, defaultLocale, fallbackLocale, defaultTimezone, systemTimezone, defaultTimeFormat, defaultDateFormat, timezoneOptions, storageKey, persist, theme: initialTheme, brand: initialBrand, density: initialDensity, fontSize: initialFontSize, onLocaleChange, onTimezoneChange, onTimeFormatChange, onDateFormatChange, onThemeChange, onBrandChange, onDensityChange, onFontSizeChange, }: AppProviderProp): import("react/jsx-runtime").JSX.Element;
4
+ export declare function AppProvider({ children, defaultLocale, fallbackLocale, defaultTimezone, systemTimezone, defaultTimeFormat, defaultDateFormat, timezoneOptions, storageKey, persist, theme: initialTheme, brand: initialBrand, density: initialDensity, fontSize: initialFontSize, scaling: initialScaling, onLocaleChange, onTimezoneChange, onTimeFormatChange, onDateFormatChange, onThemeChange, onBrandChange, onDensityChange, onFontSizeChange, onScalingChange, }: AppProviderProp): import("react/jsx-runtime").JSX.Element;
5
5
  export declare function useAppContext(): AppContextValue;
6
6
  /** Returns null outside AppProvider — used by pickers for optional context. */
7
7
  export declare function useOptionalAppContext(): AppContextValue | null;
@@ -63,6 +63,7 @@ function AppProvider({
63
63
  brand: initialBrand = null,
64
64
  density: initialDensity = "default",
65
65
  fontSize: initialFontSize = "default",
66
+ scaling: initialScaling = null,
66
67
  onLocaleChange,
67
68
  onTimezoneChange,
68
69
  onTimeFormatChange,
@@ -70,7 +71,8 @@ function AppProvider({
70
71
  onThemeChange,
71
72
  onBrandChange,
72
73
  onDensityChange,
73
- onFontSizeChange
74
+ onFontSizeChange,
75
+ onScalingChange
74
76
  }) {
75
77
  const initialLocale = defaultLocale;
76
78
  const [locale, setLocaleState] = React.useState(initialLocale);
@@ -87,6 +89,7 @@ function AppProvider({
87
89
  const [brand, setBrandState] = React.useState(initialBrand);
88
90
  const [density, setDensityState] = React.useState(initialDensity);
89
91
  const [fontSize, setFontSizeState] = React.useState(initialFontSize);
92
+ const [scaling, setScalingState] = React.useState(initialScaling);
90
93
  const hasMountedRef = React.useRef(false);
91
94
  const prefsRef = React.useRef({
92
95
  locale,
@@ -96,7 +99,8 @@ function AppProvider({
96
99
  theme,
97
100
  brand,
98
101
  density,
99
- fontSize
102
+ fontSize,
103
+ scaling
100
104
  });
101
105
  React.useEffect(() => {
102
106
  const stored = persist ? readStoredPreferences(storageKey) : {};
@@ -116,6 +120,7 @@ function AppProvider({
116
120
  const nextBrand = stored.brand ?? initialBrand;
117
121
  const nextDensity = stored.density ?? initialDensity;
118
122
  const nextFontSize = stored.fontSize ?? initialFontSize;
123
+ const nextScaling = stored.scaling ?? initialScaling;
119
124
  prefsRef.current = {
120
125
  locale: nextLocale,
121
126
  timezone: nextTimezone,
@@ -124,7 +129,8 @@ function AppProvider({
124
129
  theme: nextTheme,
125
130
  brand: nextBrand,
126
131
  density: nextDensity,
127
- fontSize: nextFontSize
132
+ fontSize: nextFontSize,
133
+ scaling: nextScaling
128
134
  };
129
135
  setLocaleState(nextLocale);
130
136
  setTimezoneState(nextTimezone);
@@ -134,6 +140,7 @@ function AppProvider({
134
140
  setBrandState(nextBrand);
135
141
  setDensityState(nextDensity);
136
142
  setFontSizeState(nextFontSize);
143
+ setScalingState(nextScaling);
137
144
  }, [
138
145
  defaultDateFormat,
139
146
  defaultLocale,
@@ -143,17 +150,28 @@ function AppProvider({
143
150
  initialBrand,
144
151
  initialDensity,
145
152
  initialFontSize,
153
+ initialScaling,
146
154
  persist,
147
155
  storageKey,
148
156
  systemTimezone
149
157
  ]);
150
158
  React.useEffect(() => {
151
- prefsRef.current = { locale, timezone, timeFormat, dateFormat, theme, brand, density, fontSize };
152
- }, [locale, timezone, timeFormat, dateFormat, theme, brand, density, fontSize]);
159
+ prefsRef.current = {
160
+ locale,
161
+ timezone,
162
+ timeFormat,
163
+ dateFormat,
164
+ theme,
165
+ brand,
166
+ density,
167
+ fontSize,
168
+ scaling
169
+ };
170
+ }, [locale, timezone, timeFormat, dateFormat, theme, brand, density, fontSize, scaling]);
153
171
  React.useEffect(() => {
154
172
  if (typeof document === "undefined") return;
155
- applyThemeAxes(document.documentElement, { theme, brand, density, fontSize });
156
- }, [theme, brand, density, fontSize]);
173
+ applyThemeAxes(document.documentElement, { theme, brand, density, fontSize, scaling });
174
+ }, [theme, brand, density, fontSize, scaling]);
157
175
  const setLocale = React.useCallback(
158
176
  (next) => {
159
177
  prefsRef.current = { ...prefsRef.current, locale: next };
@@ -226,6 +244,15 @@ function AppProvider({
226
244
  },
227
245
  [onFontSizeChange, persist, storageKey]
228
246
  );
247
+ const setScaling = React.useCallback(
248
+ (next) => {
249
+ prefsRef.current = { ...prefsRef.current, scaling: next };
250
+ setScalingState(next);
251
+ onScalingChange?.(next);
252
+ if (persist) writeStoredPreferences(storageKey, prefsRef.current);
253
+ },
254
+ [onScalingChange, persist, storageKey]
255
+ );
229
256
  const requestHeaders = React.useMemo(
230
257
  () => buildRequestHeaders(locale, timezone, timeFormat, dateFormat),
231
258
  [locale, timezone, timeFormat, dateFormat]
@@ -269,6 +296,7 @@ function AppProvider({
269
296
  brand,
270
297
  density,
271
298
  fontSize,
299
+ scaling,
272
300
  setLocale,
273
301
  setTimezone,
274
302
  setTimeFormat,
@@ -276,7 +304,8 @@ function AppProvider({
276
304
  setTheme,
277
305
  setBrand,
278
306
  setDensity,
279
- setFontSize
307
+ setFontSize,
308
+ setScaling
280
309
  }),
281
310
  [
282
311
  locale,
@@ -291,6 +320,7 @@ function AppProvider({
291
320
  brand,
292
321
  density,
293
322
  fontSize,
323
+ scaling,
294
324
  setLocale,
295
325
  setTimezone,
296
326
  setTimeFormat,
@@ -298,7 +328,8 @@ function AppProvider({
298
328
  setTheme,
299
329
  setBrand,
300
330
  setDensity,
301
- setFontSize
331
+ setFontSize,
332
+ setScaling
302
333
  ]
303
334
  );
304
335
  return /* @__PURE__ */ jsx(AppContext.Provider, { value, children });
@@ -11,6 +11,8 @@ export type StoredAppPreferences = {
11
11
  brand?: AppBrand | null;
12
12
  density?: AppDensity;
13
13
  fontSize?: AppFontSize;
14
+ /** Continuous global size multiplier; `null` defers to the density preset. */
15
+ scaling?: number | null;
14
16
  };
15
17
  export declare function readStoredPreferences(storageKey: string): StoredAppPreferences;
16
18
  export declare function writeStoredPreferences(storageKey: string, preferences: StoredAppPreferences): void;
@@ -22,7 +22,8 @@ function readStoredPreferences(storageKey) {
22
22
  theme: isAppTheme(parsed.theme) ? parsed.theme : void 0,
23
23
  brand: isAppBrand(parsed.brand) ? parsed.brand : void 0,
24
24
  density: isAppDensity(parsed.density) ? parsed.density : void 0,
25
- fontSize: isAppFontSize(parsed.fontSize) ? parsed.fontSize : void 0
25
+ fontSize: isAppFontSize(parsed.fontSize) ? parsed.fontSize : void 0,
26
+ scaling: typeof parsed.scaling === "number" && Number.isFinite(parsed.scaling) ? parsed.scaling : void 0
26
27
  };
27
28
  } catch {
28
29
  return {};
@@ -11,12 +11,15 @@ export declare const APP_THEMES: readonly ["light", "dark"];
11
11
  export declare const APP_BRANDS: readonly ["brand", "crm", "logistics", "partner", "slate"];
12
12
  export declare const APP_DENSITIES: readonly ["compact", "default", "comfortable"];
13
13
  export declare const APP_FONT_SIZES: readonly ["sm", "default", "lg"];
14
- /** The four axes as held by AppProvider. `brand: null` opts out (app token wins). */
14
+ /** The axes as held by AppProvider. `brand: null` opts out (app token wins).
15
+ * `scaling: null` defers to the density preset; a number is the continuous global
16
+ * size multiplier (the `--scaling` factor / Radix model) and overrides the preset. */
15
17
  export type AppThemeAxes = {
16
18
  theme: AppTheme;
17
19
  brand: AppBrand | null;
18
20
  density: AppDensity;
19
21
  fontSize: AppFontSize;
22
+ scaling: number | null;
20
23
  };
21
24
  export declare const isAppTheme: (v: unknown) => v is AppTheme;
22
25
  export declare const isAppBrand: (v: unknown) => v is AppBrand;
@@ -24,6 +24,10 @@ function applyThemeAxes(el, axes) {
24
24
  if (axes.brand === null) delete el.dataset.brand;
25
25
  else el.dataset.brand = axes.brand;
26
26
  }
27
+ if (axes.scaling !== void 0) {
28
+ if (axes.scaling === null) el.style.removeProperty("--scaling");
29
+ else el.style.setProperty("--scaling", String(axes.scaling));
30
+ }
27
31
  }
28
32
  export {
29
33
  APP_BRANDS,
@@ -42,6 +42,13 @@ export type AppProviderProp = {
42
42
  density?: AppDensity;
43
43
  /** Initial base type size — written to `<html data-font-size>`. Default: `"default"`. */
44
44
  fontSize?: AppFontSize;
45
+ /**
46
+ * Continuous global size multiplier — sets inline `--scaling` on `<html>`. Every
47
+ * size token (spacing, control/table/checkbox/switch heights, radius) rescales in
48
+ * proportion (Radix-style). `null` (default) defers to the `density` preset; a
49
+ * number (e.g. `0.95`) overrides it. Type is a separate axis — not scaled.
50
+ */
51
+ scaling?: number | null;
45
52
  onLocaleChange?: (locale: AppLocale) => void;
46
53
  onTimezoneChange?: (timezone: AppTimezone) => void;
47
54
  onTimeFormatChange?: (timeFormat: AppTimeFormat) => void;
@@ -50,6 +57,7 @@ export type AppProviderProp = {
50
57
  onBrandChange?: (brand: AppBrand | null) => void;
51
58
  onDensityChange?: (density: AppDensity) => void;
52
59
  onFontSizeChange?: (fontSize: AppFontSize) => void;
60
+ onScalingChange?: (scaling: number | null) => void;
53
61
  };
54
62
  /** Which AppProvider setting the {@link AppSettingPicker} reads/writes. */
55
63
  export type AppSettingKind = "locale" | "timezone" | "dateFormat" | "timeFormat" | "theme" | "brand" | "density" | "fontSize";
@@ -81,11 +89,12 @@ export type AppContextValue = {
81
89
  requestHeaders: AppRequestHeaders;
82
90
  /** Configured timezone list; `undefined` → full IANA in the timezone-picker recipe. */
83
91
  timezoneOptions?: readonly AppTimezone[];
84
- /** Current theme axes (mirror `<html data-*>`). */
92
+ /** Current theme axes (mirror `<html data-*>` / inline `--scaling`). */
85
93
  theme: AppTheme;
86
94
  brand: AppBrand | null;
87
95
  density: AppDensity;
88
96
  fontSize: AppFontSize;
97
+ scaling: number | null;
89
98
  setLocale: (locale: AppLocale) => void;
90
99
  setTimezone: (timezone: AppTimezone) => void;
91
100
  setTimeFormat: (timeFormat: AppTimeFormat) => void;
@@ -94,4 +103,5 @@ export type AppContextValue = {
94
103
  setBrand: (brand: AppBrand | null) => void;
95
104
  setDensity: (density: AppDensity) => void;
96
105
  setFontSize: (fontSize: AppFontSize) => void;
106
+ setScaling: (scaling: number | null) => void;
97
107
  };
@@ -1,61 +1,31 @@
1
1
  /*
2
- * DENSITY — one knob retunes φ-unit, controls, tables. Two entry points, same vars:
2
+ * DENSITY — named presets of the global `--scaling` factor (foundation.css).
3
+ * One knob: density sets `--scaling`, and every size token (spacing grid, control
4
+ * / table / checkbox / switch heights, radius, and everything derived from them)
5
+ * rescales in proportion. Two entry points, same variable:
3
6
  * • `<PageContainer density>` → `.ui-density-*` class (scoped to a descendant,
4
7
  * wins for its subtree by proximity).
5
- * • the density AXIS → `:root[data-density="*"]` on <html> (AppProvider density prop),
6
- * so density cascades app-wide incl. portalled overlays. PageContainer inherits it
7
- * when its `density` prop is unset (emits no class).
8
+ * • the density AXIS → `:root[data-density="*"]` on <html> (AppProvider density
9
+ * prop), so it cascades app-wide incl. portalled overlays. For a value off the
10
+ * three presets, set `--scaling` directly (AppProvider `scaling` prop).
8
11
  *
9
- * INTENTIONALLY UNLAYERED — do NOT wrap in `@layer components`. The active
10
- * tokens (--control-height, --table-row-height, --phi-unit…) get their defaults
11
- * from UNLAYERED `:root` rules in tokens/components/*.css. A layered block always
12
- * loses to an unlayered one regardless of specificity, so a layered
13
- * `:root[data-density]` would silently never override those defaults (the axis
14
- * would be a no-op on <html>). Unlayered, `:root[data-density="x"]` (0,2,0) beats
15
- * the `:root` default (0,1,0) by specificity. Apps use the prop / axis, never
16
- * these classes directly.
12
+ * INTENTIONALLY UNLAYERED — do NOT wrap in `@layer components`. `--scaling` has an
13
+ * unlayered `:root` default (foundation.css); a layered `:root[data-density]` would
14
+ * always lose to it regardless of specificity, making the axis a no-op on <html>.
15
+ * Unlayered, `:root[data-density="x"]` (0,2,0) beats the `:root` default (0,1,0).
17
16
  */
18
17
 
19
18
  .ui-density-compact,
20
19
  :root[data-density="compact"] {
21
- --control-height: var(--control-height-compact);
22
- --control-padding-x: var(--control-padding-x-compact);
23
- --table-row-height: var(--table-row-height-compact);
24
- --phi-unit: var(--space-3);
25
- --checkbox-size: var(--checkbox-size-compact);
26
- --switch-width: var(--switch-width-compact);
27
- --switch-height: var(--switch-height-compact);
28
- --switch-thumb-size: var(--switch-thumb-size-compact);
29
- --switch-thumb-translate: var(--switch-thumb-translate-compact);
30
- --table-cell-padding-y: var(--space-1);
31
- /* Tighter overlay/card chrome at compact density (12px vertical). */
32
- --space-chrome-y: var(--space-3);
20
+ --scaling: 0.92;
33
21
  }
34
22
 
35
23
  .ui-density-default,
36
24
  :root[data-density="default"] {
37
- --control-height: var(--control-height-default);
38
- --control-padding-x: var(--control-padding-x-default);
39
- --table-row-height: var(--table-row-height-default);
40
- --table-cell-padding-y: var(--space-2);
25
+ --scaling: 1;
41
26
  }
42
27
 
43
28
  .ui-density-comfortable,
44
29
  :root[data-density="comfortable"] {
45
- --control-height: var(--control-height-comfortable);
46
- /* Comfortable steps 44 → 36 → 32 (design spacing-density), steeper than the
47
- * default 4px step so sm/xs aren't left 4px too tall. */
48
- --control-height-sm: calc(var(--control-height) - 0.5rem);
49
- --control-height-xs: calc(var(--control-height) - 0.75rem);
50
- --control-padding-x: var(--control-padding-x-comfortable);
51
- --table-row-height: var(--table-row-height-comfortable);
52
- --phi-unit: var(--space-6);
53
- --checkbox-size: var(--checkbox-size-comfortable);
54
- --switch-width: var(--switch-width-comfortable);
55
- --switch-height: var(--switch-height-comfortable);
56
- --switch-thumb-size: var(--switch-thumb-size-comfortable);
57
- --switch-thumb-translate: var(--switch-thumb-translate-comfortable);
58
- --table-cell-padding-y: var(--space-2);
59
- /* Roomier overlay/card chrome at comfortable density (24px vertical). */
60
- --space-chrome-y: var(--space-6);
30
+ --scaling: 1.08;
61
31
  }
@@ -8,22 +8,21 @@
8
8
  --control-padding-x-default: var(--space-3);
9
9
  --control-padding-x-comfortable: var(--space-4);
10
10
 
11
- --control-height: var(--control-height-default);
12
- /* Adjacent control sizes, derived from the active --control-height.
13
- * Default/compact use a 4px/8px step; density overrides comfortable
14
- * (which steps 44→36→32 per the design's spacing-density spec). */
15
- --control-height-sm: calc(var(--control-height) - 0.25rem);
16
- --control-height-lg: calc(var(--control-height) + 0.25rem);
17
- --control-height-xs: calc(var(--control-height) - 0.5rem);
11
+ --control-height: calc(var(--control-height-default) * var(--scaling));
12
+ /* Adjacent control sizes, derived from the active --control-height. The ±step
13
+ * is scaled too so the whole control ladder stays proportional under --scaling. */
14
+ --control-height-sm: calc(var(--control-height) - calc(0.25rem * var(--scaling)));
15
+ --control-height-lg: calc(var(--control-height) + calc(0.25rem * var(--scaling)));
16
+ --control-height-xs: calc(var(--control-height) - calc(0.5rem * var(--scaling)));
18
17
  --control-padding-x: var(--control-padding-x-default);
19
18
  --control-gap: var(--space-inline-sm);
20
19
  --control-gap-sm: var(--space-inline-xs);
21
20
  --control-radius: var(--radius);
22
- --control-icon-size: 1rem;
23
- --control-icon-size-sm: 0.875rem;
21
+ --control-icon-size: calc(1rem * var(--scaling));
22
+ --control-icon-size-sm: calc(0.875rem * var(--scaling));
24
23
  --control-focus-ring-width: 2px;
25
24
 
26
- --checkbox-size: 1rem;
25
+ --checkbox-size: calc(1rem * var(--scaling));
27
26
  --checkbox-size-compact: 0.875rem;
28
27
  --checkbox-size-comfortable: 1.125rem;
29
28
  --choice-gap: var(--space-inline-sm);
@@ -32,16 +31,16 @@
32
31
  --choice-description-gap: 0.125rem;
33
32
  --choice-control-offset: 0.125rem;
34
33
 
35
- --switch-width: 2.25rem;
34
+ --switch-width: calc(2.25rem * var(--scaling));
36
35
  --switch-width-compact: 2rem;
37
36
  --switch-width-comfortable: 2.5rem;
38
- --switch-height: 1.25rem;
37
+ --switch-height: calc(1.25rem * var(--scaling));
39
38
  --switch-height-compact: 1.125rem;
40
39
  --switch-height-comfortable: 1.375rem;
41
- --switch-thumb-size: 1rem;
40
+ --switch-thumb-size: calc(1rem * var(--scaling));
42
41
  --switch-thumb-size-compact: 0.875rem;
43
42
  --switch-thumb-size-comfortable: 1.125rem;
44
- --switch-thumb-translate: 1rem;
43
+ --switch-thumb-translate: calc(1rem * var(--scaling));
45
44
  --switch-thumb-translate-compact: 0.875rem;
46
45
  --switch-thumb-translate-comfortable: 1.125rem;
47
46
 
@@ -4,7 +4,7 @@
4
4
  --table-row-height-compact: 1.75rem;
5
5
  --table-row-height-default: 2rem;
6
6
  --table-row-height-comfortable: 2.75rem;
7
- --table-row-height: var(--table-row-height-default);
7
+ --table-row-height: calc(var(--table-row-height-default) * var(--scaling));
8
8
  --table-cell-padding-y: var(--space-2);
9
9
  --table-cell-space-x: var(--control-padding-x);
10
10
  --table-head-font-size: var(--font-size-xs);
@@ -75,7 +75,7 @@
75
75
  --disabled-opacity: 0.5;
76
76
 
77
77
  /* Shape and elevation */
78
- --radius: 0.375rem; /* 6px radius base; override to retheme every step */
78
+ --radius: calc(0.375rem * var(--scaling)); /* 6px base × scaling; override to retheme every step */
79
79
  --radius-ratio: 1.618; /* φ — radii scale by the golden ratio (steps derive in @theme) */
80
80
  --radius-pill: 9999px; /* fully-round: switch / radio / slider / pill badges (NOT --radius-derived) */
81
81
  --radius-sharp: 0; /* squared corners: table cells, flush inputs */
@@ -93,11 +93,17 @@
93
93
  0 20px 25px -5px rgb(var(--shadow-color) / 0.1), 0 8px 10px -6px rgb(var(--shadow-color) / 0.1);
94
94
  --shadow-2xl: 0 25px 50px -12px rgb(var(--shadow-color) / 0.25);
95
95
 
96
- /* Typography scaleM PLUS 2 (JIS L1+L2 kanji, Vietnamese subset), one notch
97
- * larger than the JP-dense base for comfortable reading (body 14px). */
96
+ /* Sans stackscript-aware per the international convention for mixed
97
+ * Latin/CJK UI: native Latin system fonts FIRST (clean, familiar English &
98
+ * Vietnamese on every OS), then the bundled "M PLUS 2" + Hiragino / Noto Sans JP
99
+ * as the CJK fallback. Browsers resolve fonts per-glyph, so Latin renders in the
100
+ * system sans while 日本語 falls through to M PLUS 2 (still shipped, so JP is
101
+ * consistent across machines). Listing M PLUS 2 first — its Latin glyphs are
102
+ * tuned to harmonise with kana, not for standalone English — made English read
103
+ * oddly; Latin-first fixes that without losing the bundled JP face. */
98
104
  --font-family-sans:
99
- "M PLUS 2", "Be Vietnam Pro", "Hiragino Sans", "Noto Sans JP", -apple-system,
100
- BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
105
+ -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
106
+ system-ui, "M PLUS 2", "Hiragino Sans", "Noto Sans JP", "Be Vietnam Pro", sans-serif;
101
107
  --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
102
108
  /* ── Type scale — GOLDEN-RATIO modular scale (Ant/Tailwind model). ONE base + ONE ratio; every
103
109
  * step is base × ratioⁿ, so the whole scale stays in golden proportion. `--font-size-ratio` is
@@ -140,17 +146,29 @@
140
146
  --line-height-body: 1.7;
141
147
  --letter-spacing-tight: 0;
142
148
 
143
- /* Raw spacing scale */
149
+ /* ── SCALING the one global density knob (Radix Themes model). A single
150
+ * dimensionless multiplier on every SIZE token (spacing grid, control / table /
151
+ * checkbox / switch heights, radius), so the whole UI rescales in proportion
152
+ * from one place. `1` = the design baseline. The `density` axis sets named
153
+ * presets (compact .92 · default 1 · comfortable 1.08); AppProvider's `scaling`
154
+ * prop sets any value continuously. Type has its OWN base+ratio (--font-size-base)
155
+ * and is NOT scaled here — fontSize stays an orthogonal axis. Touch targets
156
+ * (--touch-target-min) are also exempt (a11y minimum). */
157
+ --scaling: 1;
158
+
159
+ /* Raw spacing scale — the 4px grid, scaled. Everything that derives from
160
+ * --space-* (padding, gaps, --phi-unit, semantic spacing, chrome) inherits the
161
+ * scaling automatically; this is the single highest-leverage scaling point. */
144
162
  --space-0: 0;
145
- --space-1: 0.25rem;
146
- --space-2: 0.5rem;
147
- --space-3: 0.75rem;
148
- --space-4: 1rem;
149
- --space-5: 1.25rem;
150
- --space-6: 1.5rem;
151
- --space-8: 2rem;
152
- --space-10: 2.5rem;
153
- --space-12: 3rem;
163
+ --space-1: calc(0.25rem * var(--scaling));
164
+ --space-2: calc(0.5rem * var(--scaling));
165
+ --space-3: calc(0.75rem * var(--scaling));
166
+ --space-4: calc(1rem * var(--scaling));
167
+ --space-5: calc(1.25rem * var(--scaling));
168
+ --space-6: calc(1.5rem * var(--scaling));
169
+ --space-8: calc(2rem * var(--scaling));
170
+ --space-10: calc(2.5rem * var(--scaling));
171
+ --space-12: calc(3rem * var(--scaling));
154
172
 
155
173
  /* Golden ratio scale */
156
174
  --ratio-phi: 1.6180339887;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@godxjp/ui",
3
- "version": "13.15.1",
3
+ "version": "13.16.1",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@10.29.1",
6
6
  "sideEffects": false,