feat(eidos/knob): make the size prop responsive; drop the WIP_TRACKS exception

Two corrections after verifying the relocated Knob against the recipe contract:

1. The Knob was NEVER a contract violation — every `--knob-*` alias in the css
   is consumed WITH a fallback (`var(--knob-x, default)`), which the
   recipe-css-contract treats as runtime-optional, so no recipe-token
   declaration is required. Removing `knob` from `WIP_TRACKS` keeps the full
   eidos suite green (289) — it's now first-class, not an excluded WIP track.

2. But `size` was a visual no-op: the css hardcoded `--size-md-*` everywhere,
   so `data-size` did nothing. Introduce private `--_knob-*` size vars selected
   by `[data-size]` off the global `--size-{k}-*` bundle (public `--knob-*`
   still overrides; the size-driven private is only the default; value readout
   sits one step below). Browser-verified: control diameter now sm 60 / md 72 /
   lg 88 px (was fixed 72 at any size).

npm run check unchanged at 59 (baseline); no console errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
menubar-v4-safe
dev 3 months ago
parent 8dfd3505a9
commit 9a993a2a87

@ -13,16 +13,46 @@
*/
[data-knob] {
/* Private size coordinate: `data-size` selects the global --size-{k}-*
* bundle. The public --knob-* aliases below still override per-instance;
* the private var is only the size-driven default. Value readout sits one
* step below the knob's own size. */
--_knob-gap: var(--size-md-gap);
--_knob-diameter: calc(var(--size-md-control-height) * 2);
--_knob-label-font: var(--size-md-font-size);
--_knob-value-font: var(--size-sm-font-size);
display: inline-flex;
flex-direction: column;
align-items: center;
gap: var(--knob-gap, var(--size-md-gap));
gap: var(--knob-gap, var(--_knob-gap));
}
[data-knob][data-size='sm'] {
--_knob-gap: var(--size-sm-gap);
--_knob-diameter: calc(var(--size-sm-control-height) * 2);
--_knob-label-font: var(--size-sm-font-size);
--_knob-value-font: var(--size-xs-font-size);
}
[data-knob][data-size='lg'] {
--_knob-gap: var(--size-lg-gap);
--_knob-diameter: calc(var(--size-lg-control-height) * 2);
--_knob-label-font: var(--size-lg-font-size);
--_knob-value-font: var(--size-md-font-size);
}
[data-knob][data-size='xl'] {
--_knob-gap: var(--size-xl-gap);
--_knob-diameter: calc(var(--size-xl-control-height) * 2);
--_knob-label-font: var(--size-xl-font-size);
--_knob-value-font: var(--size-lg-font-size);
}
[data-knob-control] {
position: relative;
inline-size: var(--knob-diameter, calc(var(--size-md-control-height) * 2));
block-size: var(--knob-diameter, calc(var(--size-md-control-height) * 2));
inline-size: var(--knob-diameter, var(--_knob-diameter));
block-size: var(--knob-diameter, var(--_knob-diameter));
border-radius: var(--radius-full, 9999px); /* literal: fallback for circle */
background:
/* value arc: conic gradient driven by the provider-published progress */
@ -116,13 +146,13 @@
/* ---- typography ----------------------------------------------------------- */
[data-knob-label] {
font-size: var(--size-md-font-size);
font-size: var(--_knob-label-font);
line-height: var(--leading-ui);
color: var(--color-neutral-content);
}
[data-knob-value-text] {
font-size: var(--size-sm-font-size);
font-size: var(--_knob-value-font);
line-height: var(--leading-ui);
color: var(--color-neutral-content-subtle);
font-variant-numeric: tabular-nums;

@ -37,7 +37,7 @@ const RECIPE_TOKENS = THEME_BASE_RECIPE_TOKENS as unknown as Readonly<
// applies). One shared set so every check in this file agrees; previously only
// the font-size guard excluded them and the other checks red-flagged their WIP.
// Their recipes/CSS re-enter the contract when the tracks land.
const WIP_TRACKS = new Set(['words', 'palabras', 'chronos', 'knob'])
const WIP_TRACKS = new Set(['words', 'palabras', 'chronos'])
/** Extract all CSS values from a recipe entry. Supports the three TSC
* forms: bare string/number, RecipeTokenSingle (one declaration), and

Loading…
Cancel
Save

Powered by TurnKey Linux.