v0.172.0
Minor Changes
-
#1372
7f1f7227Thanks @tenphi! - Breaking: reverted theschematerm back toscheme, and renamed the<html>attribute to match.schemawas the wrong word — the platform calls this a color scheme (prefers-color-scheme, thecolor-schemeproperty,<meta name="color-scheme">), and in Cube's own vocabulary "schema" means the data model, so auseSchema()that returns'light' | 'dark'sits next to Cloud'suseSchema()for SQL Runner as a pure homonym. This undoes the rename shipped in 0.170.0 (#1362) and fixes the older misspelling it was propagating.The API, back to
scheme:renderColorTokens()/renderPaletteTokens()/RenderPaletteOptions: theschemaoption isschemeagain —renderColorTokens({ scheme: 'dark' }).<CubeLogo>/<CubeFullLogo>: theschemaprop isschemeagain.useSchema(),resolveSchema(),subscribeSchema()andColorSchema— added in 0.170.0 — are nowuseScheme(),resolveScheme(),subscribeScheme()andColorScheme.useHighContrast()andresolveHighContrast()are unchanged.- The probe's
tokenOptions.schemaistokenOptions.schemeagain, and thepnpm probeCLI flag--schemais--scheme(--scheme hcstill means light + high contrast).
The DOM opt-in, renamed for the first time:
<html data-schema="dark">is now<html data-scheme="dark">, and the tasty state is@root(scheme=…)— so@darkcompiles to:root[data-scheme="dark"].data-contrastis unchanged.
No aliases, on either half. An alias for the attribute was measured and rejected: teaching the
@darkstate to accept both spellings takes a four-variant palette style map from 21 rules / 3.6 KB to 52 rules / 10.3 KB, because every arm has to be expanded against both attributes — a permanent 2.9× on the kit's most-used state to save a one-line edit. An app that wants a transition window can write both attributes itself; the kit reads onlydata-scheme.To migrate, rename the option, the prop, the four hooks and the attribute at your call sites. Apps that set the attribute from JS need the one write updated (
document.documentElement.setAttribute('data-scheme', …)), and any hand-written CSS selecting[data-schema]needs the same rename.