admin: ui polish pass, thirty findings from the emil audit
selected states stop changing font weight, buttons gain a pressed scale and scoped 120ms transitions with a reduced-motion override, every loading and empty state reserves its height, charts measure before first paint, hit targets rise to the 44px enhanced target where layout permits, long domains clamp to two lines on an unpadded inner span, chips and name cells truncate, tabular figures on counts and time columns, a z-index layer scale replaces magic numbers and fixes the dialog-over-confirm tie, history's empty state gains a clear-filters action, page headings balance, font smoothing and color-scheme land on the html reset.
This commit is contained in:
@@ -62,3 +62,35 @@ export const colors = stylex.defineVars({
|
||||
/** The focus ring colour. The ring itself is a floor, not a variant. */
|
||||
focus: { default: "oklch(54.6% 0.245 262.881)", [DARK]: "oklch(54.6% 0.245 262.881)" },
|
||||
});
|
||||
|
||||
/**
|
||||
* The stacking order. Three layers is the whole app: a chart tooltip floats
|
||||
* over its own panel, a dialog overlay covers the page, and a confirmation sits
|
||||
* over the dialog that opened it. Values are strings because a StyleX var holds
|
||||
* a CSS token, not a number.
|
||||
*/
|
||||
export const layers = stylex.defineVars({
|
||||
tooltip: "10",
|
||||
overlay: "50",
|
||||
confirm: "60",
|
||||
});
|
||||
|
||||
/**
|
||||
* Values that are shared but are not theme: they never vary by colour scheme,
|
||||
* and they are the same number wherever they appear.
|
||||
*
|
||||
* `defineConsts` rather than a plain exported constant, and in this module
|
||||
* rather than in `ui/styles`, because of how the compiler reads a
|
||||
* `stylex.create` body. A constant imported from an ordinary module is rejected
|
||||
* outright, and a plain export from a `.stylex.ts` module is read as a variable
|
||||
* object rather than a literal — so neither can be shared. `defineConsts` is
|
||||
* the one mechanism that inlines a literal across module boundaries, which is
|
||||
* why these are strings with their units baked in.
|
||||
*/
|
||||
export const metrics = stylex.defineConsts({
|
||||
/** WCAG 2.5.5's enhanced 44px target, applied where layout permits; some inline controls stop at 40px or above 2.5.8's 24px minimum. */
|
||||
hitTarget: "44px",
|
||||
/** The press and hover settle shared by every control that styles its own states. */
|
||||
transitionProperty: "background-color, color, border-color, transform",
|
||||
transitionDuration: "120ms",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user