1. Perceptual Contrast Guardrails
Every interactive surface must maintain at least 4.5:1 contrast for body typography and 3:1 for focus rings and control boundaries in both light and dark color schemes. Semantic elevation steps derive from the base OKLCH lightness ramp rather than opaque overlays so nested panels stay legible at every contrast setting.
2. Reduced-Motion Fallbacks
Transient disclosures (menus, popovers, dialogs, and tree branches) animate opacity and subtle translation over 120–200ms using standard deceleration curves. When prefers-reduced-motion: reduce is active, spatial travel collapses to 0px and transition durations clamp to 0s.
import * as stylex from "@stylexjs/stylex";
export const motionTokens = stylex.defineVars({
durationFast: {
default: "120ms",
"@media (prefers-reduced-motion: reduce)": "0s",
},
durationModerate: {
default: "200ms",
"@media (prefers-reduced-motion: reduce)": "0s",
},
easingStandard: "cubic-bezier(0.2, 0, 0, 1)",
});