Accessibility
Contrast that holds for any brand accent, keyboard focus everywhere, and the conventions the components follow.
Contrast
Nelumbo meets WCAG 2.1 AA in light and dark mode, for any brand accent, neutral temperature and vibrance.
- Text needs 4.5:1 against its background.
- Control boundaries, the focus ring and chart marks need 3:1.
- Roles are picked by HCT tone, not by hue, so the same contrast holds for every accent. In a Nelumbo checkout,
npm run contrastproves it: 130 color pairs, for 153 combinations of brand, neutral and vibrance, in both themes. - Each accent's solid role (
blue,green, …) works as text on the page at 4.5:1. - Amber and orange solids are deep so they can work as text. Use their
-containerroles for the bright look. borderandoutline-variantare decorative dividers, which WCAG exempts. Anything that identifies a control usesinputoroutline.- Disabled controls fade to 40% (exempt). Loading is a busy state, not a disabled one, so it stays at full strength.
Keyboard and focus
Every interactive component works from the keyboard and shows a focus ring in the ring color. The data
components go further: charts, plate maps, trees, alignments, gene models and sequences keep one item in focus
that the arrow keys move, Home and End jump to the ends, and Escape goes back.
Icons and labels
An Icon without a label is decorative and hidden from screen readers. Icon-only buttons take a label, which
becomes their accessible name. A NotificationBadge isn't announced, so put the count in its control's name.
Conventions
How the components are built, if you're extending them:
- Type roles are
type-*utilities (type-body-md), nottext-*, so stocktailwind-mergenever drops a text color next to them. - Interactive components use
state-layer(the hover, focus and press overlay) andtactile(press compression with a spring release). - Components keep shadcn's prop names and variants. Nelumbo only adds to them.
- Buttons expose their geometry as CSS variables, so wrappers can shape them without extra props:
--btn-h,--btn-pxand--btn-px-delta(padding),--btn-radius,--btn-radius-startand--btn-radius-end(per-side corners), and--press-scale(set it to 1 to turn off the press squeeze).