The maintainer can change how the app looks without leaving the component he is looking at, in the syntax he already writes every working day.
The app's appearance lives in one 242-line stylesheet: 69 rules, a grid of named areas, and a set of custom properties that carry the two themes. It was written by the agent and it is read by the agent. Changing a gap means finding the rule that owns it, and the rule is named after a layout region rather than after the thing on screen.
That is the wrong shape for what comes next. The MVP is shipped and in closed testing; what remains is a long tail of small visual changes, and those are the ones the maintainer wants to make himself, quickly, without a stage-gated round trip.
The maintainer already does exactly that in the day-job frontend, in Tailwind utilities
plus a css prop. Two vocabularies for one skill is the tax this feature
removes.
The day-job app styles with twin.macro, and that package is the part that cannot come
along:
twin.macro latest |
3.4.1, published 2024-01-19 |
| Its peer range | tailwindcss >=3.3.1 — Tailwind 3 only |
tailwindcss latest |
4.3.3 |
babel-plugin-macros, which it requires |
3.1.0, published 2023-04-29 |
Adopting it would pin a brand-new app to a Tailwind major that is already superseded, and would add a Babel macro pass to a Vite build that has no other reason to run one. That stack is pinned there today; there is no sense in importing the same block on day one.
styled-components itself is not the stale part — 6.5.3 was published
2026-09-08. Its css prop, however, needs babel-plugin-styled-components,
and the design-stage spike found that unusable on this toolchain: Vite 8's
React plugin no longer runs Babel at all, and the plugin refuses Babel 8 and
throws on it when forced. See design.md. So the css prop comes from
@emotion/react, which needs no Babel — the syntax below is written as it
actually compiles.
Utilities go in className, real CSS goes in css, and the two never mix:
import { css } from '@emotion/react'
<button
className="min-h-12 flex-1 inline-flex items-center justify-center gap-2 rounded-[10px] px-5"
css={css`
background: var(--color-btn);
color: var(--color-fg);
`}
>
Both sides take conditions:
<button
className={clsx(
'min-h-12 inline-flex items-center justify-center gap-2 rounded-[10px]',
recording ? 'bg-error text-white' : 'bg-btn',
iconOnly ? 'w-12 flex-none p-0' : 'flex-1 px-5',
)}
disabled={busy}
css={css`
${busy ? 'opacity: 0.5; cursor: default;' : 'cursor: pointer;'}
`}
>
For comparison, the same element today — src/index.css:156, reached from
RecordButton.tsx through three class names:
.btn {
min-height: 48px; padding: 0 20px; font-size: 1rem; border: 0; border-radius: 10px;
background: var(--btn); color: var(--fg); cursor: pointer; flex: 1 1 auto;
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-rec { background: var(--error); color: #fff; }
.btn-icon { flex: 0 0 auto; inline-size: 48px; padding: 0; }
And the shape this feature explicitly does not want, which is what a Tailwind-only answer would force:
// Rejected: CSS as a JavaScript object.
<div style={{ height: `${h}px`, borderLeft: `2px solid ${tone}` }}>
Utility classes in className, with Tailwind's vocabulary and its
arbitrary-value syntax (h-[100px], bg-[var(--btn)]).
A css prop taking CSS text, as a template literal, with interpolation.
Not a style object, and not a JS-object-shaped API wearing a css name. A
css tag on the template is acceptable — the day-job code imports and
writes one — as long as what sits inside it is CSS.
Both conditional on props and state, in ordinary JavaScript.
No Babel macro, and no dependency pinned to a superseded major of anything.
The app looks the same when it is done. This is a refactor. Any visible
change is a defect, not an improvement, and is judged against the phase 8
screenshots in ~/git/rpm-boss/store/.
Both themes keep working, including the data-theme attribute that
theme.ts stamps and the prefers-color-scheme rules behind it.
The CSS custom properties survive as the single source of colour.
usePalette reads --muted, --bg, --accent, --dim off the root
element to paint the waveform canvases; the canvas has no class names and
cannot be styled by utilities. Whatever the tokens are declared in, that
read must keep working.
Right-to-left still mirrors. The stylesheet uses logical properties in
23 places (inline-size 11, block-size 8, margin-inline 4,
padding-inline 1, padding-block 2) precisely so the Urdu build lays out
without a second stylesheet. Whatever replaces them must be logical too.
The Android build still builds and installs, and the web bundle does not grow by more than 15 kB gzipped. Today it is 85 kB.
The existing app is converted, not just enabled for new work. Every
component moves to the new syntax; the layout-region and component classes
in index.css go away with it. A half-converted app would leave two
vocabularies instead of removing one, which is the problem this feature
exists to solve.
No style statement is written twice. A class used in several places
today — .btn across five components, .mono, .muted, .wave — is
correct as it stands: it says "these are the same thing". Spraying the same
utility string across five call sites would lose that and make the next
change a search-and-replace. Where styling is genuinely shared it is
extracted, the way the day-job app does it: a styled component, a wrapper, or a
small shared component that owns the styling and is used by name. Which of
those, per case, is a design-stage call.
The palette lives in one file of its own, separate from any component
and from the global stylesheet. It holds the colours that are shared —
the ones that carry a meaning across the app and that a theme switch has to
change together. Both themes are defined there together, so the pair can be
read side by side; that is how the light theme's --error and --dim got
their values, and they are not inversions of the dark ones.
A one-off colour used in one place is written in place, in whatever form
suits — hex, #rrggbbaa, rgb(), rgba(), color-mix(). It does not
have to earn a name in the palette first. The palette is for what is
shared, not a gate on the colour picker.
Palette values are usable from both styling routes, by name. In the
css block and in a utility class, without importing anything into the
component and without a second name for the same colour:
<span
className="text-muted"
css={css`
border-left: 2px solid var(--color-accent);
`}
/>
They must also remain readable at runtime off the root element, because that is how the canvas gets them (requirement 7). A palette that only exists at build time, as JavaScript constants, fails this.
index.css carries a comment explaining why a number is
what it is — the --col clamp, the two --dim values, the 48 px hit
target — that reasoning moves with it rather than being dropped. Those
comments are the most valuable thing in the file.tw prop. Utilities live in className; the split between the two
props is deliberate and is what makes the css block plain CSS.poc/live-rpm keeps its own styles and is converted
only if it becomes a feature.src/index.css holds only what genuinely belongs in a global sheet —
body, and anything the canvas needs. The theme tokens have moved to the
palette file; every rule that styles a component has moved into that
component.className sites are either utilities or gone; no component
references a layout-region class such as .area-wave that is defined
somewhere else.npm run build, npm run lint and the 324 tests pass unchanged.All four are answered in design.md, three of them by a built spike rather
than by argument:
css prop — @emotion/react. styled-components was the
expectation here and lost on evidence: its css prop needs a Babel plugin
that refuses Babel 8, in a build that no longer runs Babel.@theme in its own file. One declaration
yields both var(--color-accent) for a css block and bg-accent as a
utility, and the data-theme override reaches both.css block. Nothing in the app
currently needs to.clsx or a local helper — clsx, at 239 bytes.Measured cost of the whole change: +7.1 kB gzipped, against the 15 kB budget in requirement 9.