@atom63/styles 0.1.0-beta.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.
Files changed (74) hide show
  1. package/README.md +233 -0
  2. package/generated/atom63.figma-tokens.json +21650 -0
  3. package/generated/atom63.tokens.json +21909 -0
  4. package/package.json +116 -0
  5. package/src/animations/animations.css +55 -0
  6. package/src/animations/index.css +1 -0
  7. package/src/compat/a63-from-shadcn.css +141 -0
  8. package/src/compat/index.css +2 -0
  9. package/src/compat/mdx.css +13 -0
  10. package/src/compat/shadcn.css +52 -0
  11. package/src/contracts/action.css +31 -0
  12. package/src/contracts/badge.css +68 -0
  13. package/src/contracts/choice.css +32 -0
  14. package/src/contracts/control.css +102 -0
  15. package/src/contracts/environment.css +158 -0
  16. package/src/contracts/field.css +26 -0
  17. package/src/contracts/index.css +26 -0
  18. package/src/contracts/marker.css +23 -0
  19. package/src/contracts/menu.css +100 -0
  20. package/src/contracts/overlay.css +44 -0
  21. package/src/contracts/segment.css +100 -0
  22. package/src/contracts/selection.css +21 -0
  23. package/src/contracts/skeleton.css +14 -0
  24. package/src/contracts/surface.css +56 -0
  25. package/src/contracts/toggle.css +26 -0
  26. package/src/contracts/track.css +26 -0
  27. package/src/contracts/trigger.css +28 -0
  28. package/src/contracts/widget.css +196 -0
  29. package/src/index.css +17 -0
  30. package/src/manifest/types.ts +61 -0
  31. package/src/os/index.css +2 -0
  32. package/src/os/macos.css +54 -0
  33. package/src/os/windows.css +299 -0
  34. package/src/tailwind/animations.css +8 -0
  35. package/src/tailwind/index.css +4 -0
  36. package/src/tailwind/theme.css +516 -0
  37. package/src/tailwind/utilities.css +41 -0
  38. package/src/tailwind/variants.css +64 -0
  39. package/src/test/apply-styles.ts +30 -0
  40. package/src/themes/aqua.css +240 -0
  41. package/src/themes/index.css +4 -0
  42. package/src/themes/modern.css +55 -0
  43. package/src/themes/retro.css +112 -0
  44. package/src/themes/terminal.css +179 -0
  45. package/src/tokens/brand.css +148 -0
  46. package/src/tokens/contrast.browser.test.ts +140 -0
  47. package/src/tokens/font.css +24 -0
  48. package/src/tokens/foundation/aliases.css +28 -0
  49. package/src/tokens/foundation/effects.css +31 -0
  50. package/src/tokens/foundation/fonts.css +11 -0
  51. package/src/tokens/foundation/motion.css +19 -0
  52. package/src/tokens/foundation/palette.css +255 -0
  53. package/src/tokens/foundation/primitives.css +420 -0
  54. package/src/tokens/foundation/radius.css +36 -0
  55. package/src/tokens/foundation/typography.css +191 -0
  56. package/src/tokens/foundation.css +15 -0
  57. package/src/tokens/index.css +9 -0
  58. package/src/tokens/motion.css +27 -0
  59. package/src/tokens/personalization-axes.browser.test.ts +240 -0
  60. package/src/tokens/radius.css +35 -0
  61. package/src/tokens/semantics.css +157 -0
  62. package/src/tokens/space.css +21 -0
  63. package/src/tokens/surface.css +184 -0
  64. package/src/tokens/theme-overrides.browser.test.ts +140 -0
  65. package/src/tokens/type-scale.css +20 -0
  66. package/src/tokens/widget-chrome-signature.browser.test.ts +225 -0
  67. package/src/tokens/widget-paint.browser.test.ts +98 -0
  68. package/src/utils/code-highlighting.css +35 -0
  69. package/src/utils/debug.css +453 -0
  70. package/src/utils/index.css +9 -0
  71. package/src/utils/scroll-bar.css +78 -0
  72. package/src/utils/scroll-mask.css +119 -0
  73. package/src/utils/view-transition.css +16 -0
  74. package/src/z-layers.ts +40 -0
@@ -0,0 +1,158 @@
1
+ /*
2
+ * Environment dimensions.
3
+ *
4
+ * Each dimension owns a distinct slice (see packages/styles/README.md — the
5
+ * dimension-ownership table):
6
+ * - Design Language → component sizing/proportions + interaction feedback
7
+ * - Input → ergonomics (min touch target)
8
+ * - Density → proportional rhythm
9
+ *
10
+ * Radius, color, and shadow are NOT design-language concerns — they belong to
11
+ * the semantic ramp + theme (personalization). Design language never sets radius.
12
+ */
13
+
14
+ :root {
15
+ --a63-density-scale: 1;
16
+ --a63-editable-font-size-min: 0px;
17
+ --a63-safe-area-top: env(safe-area-inset-top, 0px);
18
+ --a63-safe-area-right: env(safe-area-inset-right, 0px);
19
+ --a63-safe-area-bottom: env(safe-area-inset-bottom, 0px);
20
+ --a63-safe-area-left: env(safe-area-inset-left, 0px);
21
+ --a63-viewport-height: 100vh;
22
+ /* Two different numbers, deliberately separate:
23
+ - min-size = RENDERED geometry floor. WCAG 2.5.8 pointer minimum (24px).
24
+ Touch raises it only to 32px — the smallest rendered control
25
+ observed in shipping iOS apps (measured 30.6–31.5pt across two
26
+ apps). Apple's Accessibility page publishes an iOS
27
+ *minimum control size* of 28x28pt, so a 32pt rendered floor
28
+ sits above the documented minimum and below the 44pt default.
29
+ https://developer.apple.com/design/human-interface-guidelines/accessibility
30
+ - min-target = INTERACTION floor. Touch raises it to 44px per Apple HIG.
31
+ Recipes must floor their height ramp with min-size and expand the touch
32
+ region with min-target. Flooring rendered height with min-target is what
33
+ collapses the xs/sm/md ramp to a single 44px rung on every phone.
34
+ See docs/design-system/web-ios-token-parity.md. */
35
+ --a63-control-min-size: 1.5rem;
36
+ --a63-control-min-size-lg: var(--a63-control-min-size);
37
+ --a63-control-min-size-xl: var(--a63-control-min-size);
38
+ --a63-control-min-target: 1.5rem;
39
+ --a63-control-min-target-lg: var(--a63-control-min-target);
40
+ /* Rendered floor for a full-width ROW (a list/panel row whose whole width is
41
+ the target), as opposed to a compact control sitting inside one. A row
42
+ cannot borrow the pseudo-element trick: rows live in clipping containers
43
+ (rounded panels, scroll areas) that cut an overhanging pseudo off, so the
44
+ row's own height has to BE the target. 44px on touch — Apple's HIG default,
45
+ and our own measurement of shipping iOS apps put primary rows and
46
+ full-width controls at 42.4-44.1pt (docs/design-system/web-ios-token-parity.md).
47
+ Equal to min-size on fine pointers, so desktop is unchanged. */
48
+ --a63-row-min-size: var(--a63-control-min-size);
49
+ }
50
+
51
+ @supports (height: 100dvh) {
52
+ :root {
53
+ --a63-viewport-height: 100dvh;
54
+ }
55
+ }
56
+
57
+ /* Prevent focus zoom in mobile Safari without inflating non-editable control
58
+ labels. Editable recipes combine this floor with their normal type token. */
59
+ @media (max-width: 40rem) {
60
+ :root {
61
+ --a63-editable-font-size-min: 1rem;
62
+ }
63
+ }
64
+
65
+ /* Density — proportional rhythm */
66
+ :is([data-a63-density='compact'], [data-density='compact']) {
67
+ --a63-density-scale: 0.9;
68
+ --a63-space-unit: calc(var(--spacing-1) * 0.875);
69
+ }
70
+
71
+ :is([data-a63-density='comfortable'], [data-density='comfortable']) {
72
+ --a63-density-scale: 1;
73
+ --a63-space-unit: var(--spacing-1);
74
+ }
75
+
76
+ /* Auto-detect coarse pointers. Without this, touch ergonomics only apply when an
77
+ app explicitly passes `input` to UIProvider — an opt-in almost nothing does, so
78
+ controls stay at their 24px floor on phones. Declared before the attribute
79
+ rules below (equal specificity) so an explicit data-a63-input always wins. */
80
+ @media (pointer: coarse) {
81
+ :root {
82
+ --a63-control-min-size: 2rem;
83
+ --a63-control-min-size-lg: var(--a63-control-min-size);
84
+ --a63-control-min-size-xl: var(--a63-control-min-size);
85
+ --a63-control-min-target: 2.75rem;
86
+ --a63-control-min-target-lg: 3rem;
87
+ --a63-control-min-target-xl: 3.25rem;
88
+ --a63-row-min-size: 2.75rem;
89
+ }
90
+ }
91
+
92
+ /* Input — ergonomics (touch target). Independent of design language. */
93
+ :is([data-a63-input='touch'], [data-input='touch']) {
94
+ --a63-control-min-size: 2rem;
95
+ --a63-control-min-size-lg: var(--a63-control-min-size);
96
+ --a63-control-min-size-xl: var(--a63-control-min-size);
97
+ --a63-control-min-target: 2.75rem;
98
+ --a63-control-min-target-lg: 3rem;
99
+ --a63-control-min-target-xl: 3.25rem;
100
+ --a63-row-min-size: 2.75rem;
101
+ }
102
+
103
+ /* Explicit fine-pointer choices override coarse auto-detection (hybrid devices,
104
+ or a user who picked "pointer" in the appearance panel on a touchscreen). */
105
+ :is(
106
+ [data-a63-input='pointer'],
107
+ [data-input='pointer'],
108
+ [data-a63-input='keyboard'],
109
+ [data-input='keyboard']
110
+ ) {
111
+ --a63-control-min-size: 1.5rem;
112
+ --a63-control-min-size-lg: var(--a63-control-min-size);
113
+ --a63-control-min-size-xl: var(--a63-control-min-size);
114
+ --a63-control-min-target: 1.5rem;
115
+ --a63-control-min-target-lg: var(--a63-control-min-target);
116
+ --a63-control-min-target-xl: var(--a63-control-min-target);
117
+ --a63-row-min-size: var(--a63-control-min-size);
118
+ }
119
+
120
+ /*
121
+ * Design language — component sizing/proportions + interaction feedback only.
122
+ * The base :root (control.css) is the web default; iOS overrides sizing + feel.
123
+ * No radius, color, or touch-target here.
124
+ */
125
+ :is([data-a63-design-language='ios'], [data-design-language='ios']) {
126
+ --a63-control-height-xs: calc(var(--a63-space-unit) * 9);
127
+ --a63-control-height-sm: calc(var(--a63-space-unit) * 10);
128
+ --a63-control-height-md: calc(var(--a63-space-unit) * 11);
129
+ --a63-control-height-lg: calc(var(--a63-space-unit) * 12);
130
+ --a63-control-height-xl: calc(var(--a63-space-unit) * 13);
131
+ --a63-control-padding-inline-xs: var(--a63-space-3);
132
+ --a63-control-padding-inline-sm: var(--a63-space-3_5);
133
+ --a63-control-padding-inline-md: var(--a63-space-4);
134
+ --a63-control-padding-inline-lg: var(--a63-space-5);
135
+ --a63-control-padding-inline-xl: var(--a63-space-6);
136
+ --a63-control-font-weight: 600;
137
+ --a63-control-font-size-xs: var(--typography-xs-font-size);
138
+ --a63-control-font-size-sm: var(--typography-sm-font-size);
139
+ --a63-control-font-size-md: var(--typography-base-font-size);
140
+ --a63-control-font-size-lg: var(--typography-lg-font-size);
141
+ --a63-control-font-size-xl: var(--typography-lg-font-size);
142
+ --a63-control-icon-size-xs: 0.875rem;
143
+ --a63-control-icon-size-sm: 1rem;
144
+ --a63-control-icon-size-md: 1.125rem;
145
+ --a63-control-icon-size-lg: 1.25rem;
146
+ --a63-control-icon-size-xl: 1.375rem;
147
+ --a63-control-press-transform: scale(0.97);
148
+ --a63-control-feedback-ease: var(--a63-motion-ease-emphasized);
149
+ /* Rows stop padding their way to height and let the control ramp floor them,
150
+ so a single-line row lands on 44pt and a two-line row on ~59pt, instead of
151
+ 52pt and 75pt. Targets are from our measurement study, not a published
152
+ Apple row height — there isn't one. */
153
+ --a63-row-padding-block-xs: var(--a63-space-1);
154
+ --a63-row-padding-block-sm: var(--a63-space-1_5);
155
+ --a63-row-padding-block-md: var(--a63-space-2);
156
+ /* Larger, iconic iOS pill switch (web default is 1rem in selection.css). */
157
+ --a63-switch-thumb-size: 1.375rem;
158
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Field contract — the RECESSED control (text inputs), the inset counterpart to
3
+ * the raised control (buttons) in control.css.
4
+ *
5
+ * A field is a control: it reuses the control SIZING ramp
6
+ * (--a63-control-height/padding-inline/font-size/radius), so it inherits
7
+ * design-language (iOS taller) sizing for free.
8
+ *
9
+ * Theme-overridable hooks: --a63-field-{background,border,radius,shadow,
10
+ * focus-ring,focus-border}. Only --a63-field-shadow gets a default here — it is
11
+ * mode-independent (static inset), so it's safe to declare at :root and let
12
+ * themes override it on their shell. The OTHER hooks resolve at the recipe
13
+ * use-site against mode/theme/brand-dependent semantics (--a63-surface-control,
14
+ * --a63-border-control, --a63-control-radius, --a63-focus-ring,
15
+ * --a63-action-primary); declaring THOSE at :root would freeze their var()s to
16
+ * the root's mode/theme and inherit the wrong value down — the
17
+ * resolve-at-declaration trap. So they stay UNSET here and the recipe reads
18
+ * `var(--a63-field-X, <semantic>)`: a theme override wins, else the live
19
+ * semantic resolves per the field's own scope. A theme sets --a63-field-shadow
20
+ * (all four) and, where it re-skins the fill, --a63-field-background (terminal).
21
+ */
22
+
23
+ :root {
24
+ /* Recessed inset — mode-independent, so safe to default here. */
25
+ --a63-field-shadow: inset 0 1px 2px color-mix(in oklch, black 6%, transparent);
26
+ }
@@ -0,0 +1,26 @@
1
+ /* Control base MUST load before environment: the design-language block in
2
+ environment.css overrides the control ramp through `[data-a63-design-language]`,
3
+ which has the SAME (0,1,0) specificity as control.css's `:root` default, so
4
+ source order decides. Loading environment first silently killed the entire iOS
5
+ control ramp — heights, padding, type, and press feedback all stayed on the web
6
+ defaults. The selector cannot be strengthened to `:root:is(...)` instead,
7
+ because the axis must also apply when scoped to a nested UIProvider.
8
+ Custom properties resolve lazily, so control.css referencing
9
+ --a63-space-unit (declared in environment.css) is unaffected by this order. */
10
+ @import './control.css';
11
+ @import './environment.css';
12
+ @import './action.css';
13
+ @import './field.css';
14
+ @import './selection.css';
15
+ @import './choice.css';
16
+ @import './segment.css';
17
+ @import './toggle.css';
18
+ @import './trigger.css';
19
+ @import './menu.css';
20
+ @import './overlay.css';
21
+ @import './surface.css';
22
+ @import './track.css';
23
+ @import './marker.css';
24
+ @import './widget.css';
25
+ @import './badge.css';
26
+ @import './skeleton.css';
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Marker contract — the tiny NON-interactive labeled chip (keycap, badge, chip,
3
+ * tag, inline code). Presentational; no state.
4
+ *
5
+ * Lean by design (see the taxonomy spec): semantics carry the whole look — the
6
+ * recipe reads --a63-surface-muted (bg), --a63-text-secondary (fg),
7
+ * --a63-border-subtle (border), --a63-control-radius (radius) and
8
+ * --a63-control-font-family (→ terminal-mono for free) at the use-site. The ONE
9
+ * thing themes vary distinctly for a keycap is its BEVEL, so that is the only
10
+ * contract token here.
11
+ *
12
+ * --a63-marker-shadow is a static keycap shadow (mode-independent), so it's safe
13
+ * to default at :root. Default is `none` — modern and terminal are flat pills
14
+ * (spec: "terminal none"); aqua and retro give it keycap character.
15
+ */
16
+
17
+ :root {
18
+ /* `0 0 #0000` rather than `none`: recipes compose this into comma-separated
19
+ box-shadow lists (e.g. `var(--a63-marker-shadow), <focus ring>`), and `none`
20
+ is only legal as the sole value — it would invalidate the whole declaration
21
+ and silently drop the focus ring. This paints nothing. */
22
+ --a63-marker-shadow: 0 0 #0000;
23
+ }
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Menu contract — the actionable MENU archetype: DropdownMenu, ContextMenu,
3
+ * Select, Autocomplete, and Menubar menus. One token set so every menu surface
4
+ * reads the SAME item / popup treatment (spacing, radius, highlight,
5
+ * destructive), consumed by the shared `.a63-Menu-*` recipe (including Select /
6
+ * Autocomplete surfaces + items). The popup *surface* treatment (gel / bevel /
7
+ * backdrop / elevation) comes from the OVERLAY contract — this contract only
8
+ * adds the menu-specific item + chrome vocabulary.
9
+ *
10
+ * ── TWO tonal styles for the HIGHLIGHTED item (mirrors `segment`) ───────────
11
+ * 1. neutral (default) — a quiet hover fill (--a63-surface-control-hover).
12
+ * 2. primary — the accent fill (the classic macOS menu highlight).
13
+ * Selected by a tone flag / theme default; the RESTING + destructive treatment
14
+ * is shared by both tones.
15
+ *
16
+ * ── AXIS TRAP (see selection.css) ──────────────────────────────────────────
17
+ * Colour hooks reference mode/theme/brand semantics, so they are NOT declared
18
+ * at :root (a var(--a63-action-*) resolved at :root freezes to the root mode).
19
+ * They are consumed at the recipe USE-SITE with the live-semantic fallback in
20
+ * the API block below, and a theme overrides them under [data-a63-theme].
21
+ * Only axis-independent geometry + treatment defaults live at :root here.
22
+ */
23
+
24
+ :root {
25
+ /* ── Popup box metrics (surface treatment = OVERLAY contract) ──────────── */
26
+ --a63-menu-popup-padding: var(--a63-space-1);
27
+
28
+ /*
29
+ * NOTE: --a63-menu-popup-radius and --a63-menu-item-radius are NOT declared
30
+ * here. Radius is a THEME-VARYING axis (themes set --a63-overlay-radius /
31
+ * --a63-control-radius), so declaring them at :root would freeze them to the
32
+ * root (modern) value and inherit it into every theme — the same resolve-at-
33
+ * declaration trap as the colour hooks. They are read at the recipe use-site:
34
+ * popup -> var(--a63-menu-popup-radius, var(--a63-overlay-radius, --radius-lg))
35
+ * item -> popup radius - popup border - popup padding (concentric inset)
36
+ * A theme MAY set --a63-menu-*-radius under [data-a63-theme] to override.
37
+ */
38
+
39
+ /* ── Item geometry ─────────────────────────────────────────────────────── */
40
+ --a63-menu-item-padding-block: var(--a63-space-1_5);
41
+ --a63-menu-item-padding-inline: var(--a63-space-2);
42
+ --a63-menu-item-gap: var(--a63-space-2); /* icon <-> label gap WITHIN an item */
43
+ --a63-menu-gap: var(--a63-space-0_5); /* vertical gap BETWEEN items/rows */
44
+ --a63-menu-item-font-size: var(--a63-control-font-size-sm);
45
+ --a63-menu-item-inset: 2rem; /* checkbox / radio / inset indent */
46
+
47
+ /* ── Highlight treatment (theme-varying gel / glow; none at :root = flat) ── */
48
+ --a63-menu-highlight-gloss: none;
49
+ --a63-menu-highlight-shadow: none;
50
+
51
+ /* ── Disabled fade (foreground-only intent, like Button) ───────────────── */
52
+ --a63-menu-disabled-opacity: 0.56;
53
+ }
54
+
55
+ /*
56
+ * Menu spacing follows item shape. At the 'none' radius scale, rows become square
57
+ * and the menu collapses to a flat, flush list: no inter-item gap and no popup
58
+ * inset, so highlighted rows span edge-to-edge — the dense CRT / Win98 menu.
59
+ * At every other radius scale (subtle/default/round), the inset/gapped rhythm is
60
+ * restored for rounded highlights.
61
+ */
62
+ [data-a63-radius='none'] {
63
+ --a63-menu-gap: 0;
64
+ --a63-menu-item-radius: 0;
65
+ --a63-menu-popup-padding: 0;
66
+ }
67
+
68
+ /*
69
+ * ── COLOUR API ──────────────────────────────────────────────────────────────
70
+ * Consume each at the recipe USE-SITE with the live-semantic fallback shown, e.g.
71
+ * background: var(--a63-menu-highlight-background, var(--a63-surface-control-hover));
72
+ * A theme overrides any of these under [data-a63-theme='…'] (non-:root, resolves
73
+ * in context). NEVER declare these at :root.
74
+ *
75
+ * Item (resting) — shared by both tones:
76
+ * --a63-menu-item-foreground → var(--a63-text-primary)
77
+ * --a63-menu-item-icon → var(--a63-text-secondary)
78
+ *
79
+ * Highlighted item — NEUTRAL tone (default):
80
+ * --a63-menu-highlight-background → var(--a63-surface-control-hover)
81
+ * --a63-menu-highlight-foreground → var(--a63-text-primary)
82
+ *
83
+ * Highlighted item — PRIMARY tone ([data-tone='primary'] or a themed default):
84
+ * --a63-menu-highlight-primary-background → var(--a63-action-primary)
85
+ * --a63-menu-highlight-primary-foreground → var(--a63-action-primary-foreground)
86
+ *
87
+ * Destructive item:
88
+ * --a63-menu-destructive-foreground → var(--a63-action-danger)
89
+ * --a63-menu-destructive-highlight-background
90
+ * → color-mix(in oklch, var(--a63-action-danger) 10%, transparent)
91
+ *
92
+ * Chrome:
93
+ * --a63-menu-popup-background → var(--a63-surface-overlay)
94
+ * --a63-menu-popup-gloss → var(--a63-overlay-gloss)
95
+ * --a63-menu-label-foreground → var(--a63-text-secondary)
96
+ * --a63-menu-separator → var(--a63-border-subtle)
97
+ * --a63-menu-shortcut-foreground → var(--a63-text-secondary)
98
+ * --a63-menu-indicator → var(--a63-text-primary) (check/radio mark)
99
+ * --a63-menu-selected-indicator → var(--a63-action-primary) (Select current-value check)
100
+ */
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Overlay contract — the FLOATING elevated surface (menus, popovers, select
3
+ * popups, tooltips, dialogs, toasts, drawers).
4
+ *
5
+ * Lean by design (see the taxonomy spec): semantics carry the default look — the
6
+ * recipe reads --a63-surface-overlay (bg), --a63-border-subtle (border),
7
+ * --radius-lg (radius), --z-layer-popover (stacking), --a63-control-feedback-*
8
+ * (entrance) at the use-site. The ONE thing themes vary distinctly for a floating
9
+ * surface is its ELEVATION, so that is the only contract token here.
10
+ *
11
+ * --a63-overlay-shadow is a drop/elevation (mode-independent), so it's safe to
12
+ * default at :root and let each theme override it on its shell (modern soft,
13
+ * aqua glassy halo, retro hard Win98 offset, terminal phosphor glow).
14
+ *
15
+ * The contract now carries the full treatment vocabulary plus a drag-shadow
16
+ * (elevation while a floating surface is dragged).
17
+ */
18
+
19
+ :root {
20
+ /* Outer elevation (existing lever, unchanged). */
21
+ --a63-overlay-shadow:
22
+ 0 8px 24px -6px color-mix(in oklch, black 22%, transparent),
23
+ 0 2px 6px -2px color-mix(in oklch, black 12%, transparent);
24
+
25
+ /* Elevation while a floating surface is dragged (widgets, window frames).
26
+ Defaults to the resting shadow; a theme/consumer lifts it during drag. */
27
+ --a63-overlay-drag-shadow: var(--a63-overlay-shadow);
28
+
29
+ /* `0 0 #0000` not `none`: composed into comma-separated box-shadow lists
30
+ (`var(--a63-overlay-inner-shadow), var(--a63-overlay-shadow)`). `none` is
31
+ only legal as the sole value, so it invalidates the whole declaration and
32
+ silently drops the overlay's elevation. */
33
+ --a63-overlay-inner-shadow: 0 0 #0000;
34
+ --a63-overlay-gloss: none;
35
+ --a63-overlay-highlight: none;
36
+ --a63-overlay-highlight-opacity: 1;
37
+ --a63-overlay-backdrop: none;
38
+ --a63-overlay-border-style: solid;
39
+ --a63-overlay-border-width: 1px;
40
+ --a63-overlay-texture-image: none;
41
+ --a63-overlay-texture-blend: normal;
42
+ /* --a63-overlay-radius intentionally unset at :root; recipes read
43
+ var(--a63-overlay-radius, <own default>) so themes can square all overlays. */
44
+ }
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Segment contract — the SELECTABLE / GROUPED action-control archetype.
3
+ *
4
+ * Covers the controls that present a SET of options where a resting cell flips to
5
+ * a SELECTED cell: Toggle, ToggleGroup, SegmentedControl, Tabs, and other option
6
+ * / group-action rows. These are NOT single call-to-action buttons (that is the
7
+ * `control` archetype) — so they get their OWN namespace and never borrow the
8
+ * Button's control chrome. This is the token home for "secondary action controls."
9
+ *
10
+ * ── TWO authored tonal styles for the SELECTED cell ────────────────────────
11
+ * 1. neutral (default) — a quiet neutral fill (the segmented-control default).
12
+ * 2. primary — the brand-accent fill (radio-like emphasis / a
13
+ * highlighted current selection).
14
+ * The recipe picks one via a tone flag, e.g. [data-tone='primary'].
15
+ * The RESTING + HOVER treatment is shared by both tones — only the selected
16
+ * cell differs between neutral and primary.
17
+ *
18
+ * ── AXIS TRAP (learned on Input/Switch — see selection.css) ────────────────
19
+ * Tokens whose value references mode/theme/brand semantics — every COLOUR here
20
+ * (the fills + foregrounds, e.g. --a63-action-neutral is mode-split light/dark,
21
+ * --a63-action-primary follows the brand axis) — must NOT be declared at :root.
22
+ * A var(--a63-action-*) resolved at :root freezes to the root's mode/theme and
23
+ * inherits that frozen value into .dark / [data-a63-theme] subtrees.
24
+ * So: the COLOUR hooks are consumed at the recipe USE-SITE with the live-semantic
25
+ * fallback shown in the API block below, and a THEME overrides them under its
26
+ * own [data-a63-theme='…'] scope (never :root). Only axis-INDEPENDENT geometry
27
+ * + treatment defaults are declared at :root here.
28
+ */
29
+
30
+ :root {
31
+ /* ── Geometry (axis-independent, safe at :root) ──────────────────────── */
32
+ --a63-segment-border-width: var(--a63-control-border-width);
33
+ --a63-segment-gap: 0; /* welded by default; a gapped variant overrides */
34
+
35
+ /*
36
+ * RADIUS is read at the recipe USE-SITE, NOT declared here. It's multiplier-
37
+ * dependent (--radius-md/-sm), so a :root declaration would freeze to the root
38
+ * multiplier and ignore the radius axis (the same trap fixed in menu.css):
39
+ * bar / outer cell -> var(--a63-segment-radius, var(--radius-md))
40
+ * inset selected -> var(--a63-segment-selected-radius, var(--radius-sm))
41
+ * Grouped/segmented controls stay TIGHTER than a standalone control pill (they
42
+ * do NOT read --a63-control-radius, which a theme can inflate to a pill).
43
+ *
44
+ * TREATMENT (track/selected gloss + shadow) is likewise read at the use-site,
45
+ * bridging to the control archetype until a theme/Figma sets a segment value:
46
+ * track -> var(--a63-segment-track-gloss, var(--a63-control-gloss))
47
+ * var(--a63-segment-track-shadow, var(--a63-control-shadow))
48
+ * selected -> var(--a63-segment-selected-gloss, var(--a63-control-gloss))
49
+ * var(--a63-segment-selected-shadow,var(--a63-control-shadow))
50
+ * A theme/Figma overrides any of these under [data-a63-theme='…'] to give
51
+ * segments their OWN character instead of borrowing the button's.
52
+ */
53
+ }
54
+
55
+ /*
56
+ * ── COLOUR API ─────────────────────────────────────────────────────────────
57
+ * Consume each at the recipe USE-SITE with the live-semantic fallback shown, e.g.
58
+ * background: var(--a63-segment-selected-background, var(--a63-action-neutral));
59
+ * Themes override any of these under [data-a63-theme='…'] (a non-:root scope, so
60
+ * the value resolves in context, not frozen). Do NOT declare these at :root.
61
+ *
62
+ * Track (the grouped container / bar):
63
+ * --a63-segment-track-background → transparent
64
+ * --a63-segment-track-border → var(--a63-border-subtle)
65
+ * --a63-segment-seam → var(--a63-border-subtle) (divider between cells)
66
+ *
67
+ * Resting cell (unselected) — shared by BOTH tones:
68
+ * --a63-segment-foreground → var(--a63-text-secondary)
69
+ * --a63-segment-background → transparent (or a muted fill)
70
+ * --a63-segment-gloss → none (aqua: soft mid-line gel + card→muted)
71
+ * --a63-segment-hover-background → var(--a63-surface-control-hover)
72
+ * --a63-segment-hover-foreground → var(--a63-text-primary)
73
+ *
74
+ * Selected cell — NEUTRAL tone (default):
75
+ * --a63-segment-selected-background → var(--a63-action-neutral)
76
+ * --a63-segment-selected-foreground → var(--a63-action-neutral-foreground)
77
+ * --a63-segment-selected-gloss → var(--a63-control-gloss)
78
+ * --a63-segment-selected-shadow → var(--a63-control-shadow)
79
+ * (aqua Toggle: inset pressed-in; SegmentedControl indicator uses control shadow)
80
+ *
81
+ * Selected cell — PRIMARY / accent tone:
82
+ * --a63-segment-primary-background → var(--a63-action-primary)
83
+ * --a63-segment-primary-foreground → var(--a63-action-primary-foreground)
84
+ * --a63-segment-primary-shadow → (optional deeper inset; falls back to selected)
85
+ *
86
+ * Disabled foreground fade (matches Button — foreground only, fill intact):
87
+ * --a63-segment-disabled-opacity → 0.56 (aqua ToggleGroup: 0.4 per Figma)
88
+ *
89
+ * ── TRANSITIONAL FALLBACKS (Toggle/ToggleGroup wired 2026-07-21) ───────────────
90
+ * The fallbacks ABOVE are the target intent. To land the Toggle/ToggleGroup
91
+ * rewire value-preservingly, the recipes currently fall back to the PRE-EXISTING
92
+ * toggle values (the tokens are unset, so these apply until a theme/Figma sets a
93
+ * --a63-segment-* value). Differences to retune in Figma:
94
+ * - resting foreground: recipe falls back to --a63-text-primary (intent above =
95
+ * --a63-text-secondary, i.e. quieter unselected cells).
96
+ * - NEUTRAL selected: standalone Toggle falls back to --a63-surface-muted (the
97
+ * quiet pressed pill), while a welded ToggleGroup cell falls back to
98
+ * --a63-action-neutral (the loud inverted segmented-cell). Same token, two
99
+ * use-site fallbacks — Figma decides whether to unify or split (muted vs loud).
100
+ */
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Selection contract — shared value tokens for bistate/selection controls
3
+ * (Switch now; Checkbox + Radio next). The "on" fill is the brand primary, so a
4
+ * checked control follows the brand axis AND each theme's primary for free.
5
+ *
6
+ * The axis-dependent hooks (--a63-selection-accent / -track-off / -border /
7
+ * -focus-ring, which reference mode/theme/brand semantics) are resolved at the
8
+ * recipe USE-SITE via `var(--a63-selection-X, <live semantic>)` — declaring them
9
+ * at :root would freeze their var()s to the root's mode/theme (the
10
+ * resolve-at-declaration trap, learned on Input). So only the axis-independent
11
+ * defaults live here: the knob colour and the switch geometry driver.
12
+ */
13
+
14
+ :root {
15
+ /* The knob — always white (an iOS switch thumb is white in light AND dark). */
16
+ --a63-selection-thumb: white;
17
+ /* Ink on the white knob — fixed dark, never mode text (which washes out in dark). */
18
+ --a63-selection-thumb-fg: color-mix(in oklch, black 78%, transparent);
19
+ /* Drives the switch track geometry; iOS enlarges it in environment.css. */
20
+ --a63-switch-thumb-size: 1rem;
21
+ }
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Skeleton appearance contract.
3
+ *
4
+ * Renderers may use different masking primitives, but the base surface and
5
+ * highlight emphasis remain shared design semantics.
6
+ */
7
+ :root {
8
+ --a63-skeleton-base: var(--a63-surface-muted);
9
+ --a63-skeleton-highlight: var(--color-white-60);
10
+ }
11
+
12
+ :is(.dark, [data-a63-mode='dark']) {
13
+ --a63-skeleton-highlight: var(--color-white-10);
14
+ }
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Surface contract — the STATIC, in-flow container/panel (cards, panels,
3
+ * frames, sections, accordion containers, windows). The counterpart to OVERLAY:
4
+ * same "grouped surface" idea, but no z-stacking / elevation-above-page — it
5
+ * sits IN the flow.
6
+ *
7
+ * Lean by design (see the taxonomy spec): semantics carry the default look — the
8
+ * recipe reads --a63-surface-panel (bg), --a63-border-subtle (border),
9
+ * --radius-* (radius), --a63-text-* (text) at the use-site. The ONE thing themes
10
+ * vary distinctly for a static surface is its FLUSH-vs-LIFT-vs-BEVEL treatment,
11
+ * so that is the only contract token here.
12
+ *
13
+ * --a63-surface-shadow is a drop/bevel (mode-independent), so it's safe to
14
+ * default at :root and let each theme override it on its shell (modern soft-flush,
15
+ * aqua subtle glassy lift, retro hard Win98 frame bevel, terminal phosphor edge).
16
+ *
17
+ * The contract now carries the full treatment vocabulary
18
+ * (gloss/highlight/backdrop/border/texture/inner-shadow), not just the shadow.
19
+ */
20
+
21
+ :root {
22
+ /* Outer elevation — flush · bevel · drop · glow (existing lever, unchanged). */
23
+ --a63-surface-shadow:
24
+ 0 1px 2px color-mix(in oklch, black 6%, transparent),
25
+ 0 1px 1px color-mix(in oklch, black 4%, transparent);
26
+
27
+ /* Recessed/inset treatment (sunken well). `0 0 #0000` = flat.
28
+ NOT `none`: this token is composed into comma-separated box-shadow lists
29
+ (`var(--a63-surface-inner-shadow), var(--a63-surface-shadow)`), and `none`
30
+ is only legal as the sole value — it invalidates the whole declaration and
31
+ silently drops the surface's elevation. */
32
+ --a63-surface-inner-shadow: 0 0 #0000;
33
+
34
+ /* Top-half sheen gradient (background-image layer). none = no sheen. */
35
+ --a63-surface-gloss: none;
36
+
37
+ /* Rim/edge specular highlight (recipe ::after or an inset shadow layer). */
38
+ --a63-surface-highlight: none;
39
+ --a63-surface-highlight-opacity: 1;
40
+
41
+ /* backdrop-filter (blur/saturate) for translucent glass. none = opaque. */
42
+ --a63-surface-backdrop: none;
43
+
44
+ /* Bevel controls. */
45
+ --a63-surface-border-style: solid;
46
+ --a63-surface-border-width: 1px;
47
+
48
+ /* Texture layer: an extra background-image (scanline/pinstripe) + its blend. */
49
+ --a63-surface-texture-image: none;
50
+ --a63-surface-texture-blend: normal;
51
+
52
+ /* Radius is intentionally NOT defaulted here — recipes read
53
+ var(--a63-surface-radius, <own default>); a theme sets it to square all
54
+ surfaces (retro → 0). Declaring it here would flatten per-recipe radii, so
55
+ it stays unset at :root. */
56
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Toggle contract — persistent on/off controls.
3
+ *
4
+ * Covers standalone Toggle. ToggleGroup is always a joined segmented bar and
5
+ * reads the segment contract for cell chrome; it does not use a layout variant.
6
+ *
7
+ * Colour hooks resolve at recipe use-sites:
8
+ * --a63-toggle-background -> transparent
9
+ * --a63-toggle-foreground -> var(--a63-text-primary)
10
+ * --a63-toggle-hover-background -> var(--a63-surface-control-hover)
11
+ * --a63-toggle-on-background -> var(--a63-surface-muted)
12
+ * --a63-toggle-on-foreground -> var(--a63-text-primary)
13
+ * --a63-toggle-primary-background -> var(--a63-action-primary)
14
+ * --a63-toggle-primary-foreground -> var(--a63-action-primary-foreground)
15
+ */
16
+
17
+ :root {
18
+ --a63-toggle-border-width: var(--a63-segment-border-width);
19
+ --a63-toggle-gap: var(--a63-control-gap);
20
+ --a63-toggle-group-gap: var(--a63-segment-gap);
21
+ --a63-toggle-radius: var(--a63-control-radius);
22
+ --a63-toggle-shadow: none;
23
+ --a63-toggle-shadow-active: none;
24
+ --a63-toggle-text-shadow: none;
25
+ --a63-toggle-disabled-opacity: 0.56;
26
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Track contract — the RECESSED rail that holds raised cells/thumbs
3
+ * (segmented-control track, slider rail, tabs list). Distinct from FIELD (holds
4
+ * text, not interactive cells) and from CONTROL (raised). The ACTIVE cell/thumb
5
+ * that rides in the track reuses the CONTROL contract (e.g. the segmented
6
+ * indicator reads --a63-control-shadow); the track itself is the sunken well.
7
+ *
8
+ * Lean by design (see the taxonomy spec): semantics carry the default look — the
9
+ * recipe reads --a63-surface-control (bg), --a63-control-radius (radius) and its
10
+ * inset/gap constants at the use-site. The ONE thing themes vary distinctly for a
11
+ * recessed rail is its INSET-WELL depth, so that is the only contract token here.
12
+ *
13
+ * --a63-track-shadow is a static inset (mode-independent, like --a63-field-shadow),
14
+ * so it's safe to default at :root and let each theme override it on its shell
15
+ * (modern faint inset, aqua deeper sunken gel, retro Win98 inset well, terminal
16
+ * faint phosphor inset).
17
+ *
18
+ * NOTE: the joined-ToggleGroup bar is intentionally a RAISED control (it reads the
19
+ * CONTROL contract — aqua gel / retro bevel), NOT a track. "Segmented set" has two
20
+ * valid archetype expressions: recessed-well (SegmentedControl) vs raised-bar
21
+ * (joined ToggleGroup). Only the recessed one is `track`.
22
+ */
23
+
24
+ :root {
25
+ --a63-track-shadow: inset 0 1px 1px color-mix(in oklch, black 6%, transparent);
26
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Trigger contract — controls whose main job is to open another surface.
3
+ *
4
+ * Covers DropdownMenuTrigger, PopoverTrigger, SelectTrigger, NavigationMenu
5
+ * trigger, Menubar trigger, and disclosure-style triggers. A trigger can render
6
+ * as button-like, field-like, or navigation-like, but it needs an explicit open
7
+ * state so "pressed" is not confused with Button's momentary press.
8
+ *
9
+ * Axis-dependent hooks resolve at the recipe use-site:
10
+ * --a63-trigger-background -> transparent / field background / action fill
11
+ * --a63-trigger-foreground -> var(--a63-text-primary)
12
+ * --a63-trigger-hover-background -> var(--a63-surface-control-hover)
13
+ * --a63-trigger-open-background -> var(--a63-surface-control-hover)
14
+ */
15
+
16
+ :root {
17
+ --a63-trigger-border-width: var(--a63-control-border-width);
18
+ --a63-trigger-focus-ring-width: var(--a63-control-focus-ring-width);
19
+ --a63-trigger-gap: var(--a63-control-gap);
20
+ --a63-trigger-indicator-size: 1em;
21
+ --a63-trigger-radius: var(--a63-control-radius);
22
+ /* `0 0 #0000` not `none` — composed into comma-separated box-shadow lists
23
+ alongside the focus ring, where `none` invalidates the declaration. */
24
+ --a63-trigger-shadow: 0 0 #0000;
25
+ --a63-trigger-open-shadow: var(--a63-trigger-shadow);
26
+ --a63-trigger-feedback-duration: var(--a63-control-feedback-duration);
27
+ --a63-trigger-feedback-ease: var(--a63-control-feedback-ease);
28
+ }