vael-ui

Styling and cascade layers

vael-ui ships in @layer ui-components. Unlayered CSS always wins over a layer regardless of specificity, so a plain, unlayered base reset silently overrides vael-ui internals. Fix: put your base styles in a layer too, ordered first.

Layer order

/* your app's main stylesheet, e.g. style.css */
@layer app-base, ui-components;

@layer app-base {
  * { margin: 0; box-sizing: border-box; }
  button, input, textarea, select { font: inherit; }
}
// main.ts
import './style.css'        // your base layer, loads first
import 'vael-ui/style.css'  // now sorts after app-base

Two files, that's it. Import order here only controls layer position, nothing else, an unlayered override anywhere always still wins regardless of load order.

Deliberately overriding one component (ui prop, a Tailwind utility) wants your rule to win, keep that CSS unlayered as it already is by default. See Using with Tailwind.

CSS variables

Every color, radius, shadow, and motion value in vael-ui reads from a CSS custom property. Override any of them in your own unlayered stylesheet:

/* your own global stylesheet, unlayered so it always wins */
:root {
  --ui-primary: #6366f1;
  --ui-radius: 6px;
}

ConfigProvider's theme prop covers primary, danger, and radius for dynamic, JS-driven theming. Everything else here is CSS-only.

Colors

VariableDefaultDescription
--ui-primary#18181bPrimary action color (buttons, links, focus accents).
--ui-primary-hover#27272aHover state for the primary color.
--ui-primary-contrast#fafafaText/icon color on top of the primary color.
--ui-muted#f4f4f5Subtle background for secondary surfaces.
--ui-muted-hover#e4e4e7Hover state for muted backgrounds.
--ui-dangeroklch(0.586 0.253 26)Destructive/error color.
--ui-danger-hoverHover state for this color.
--ui-danger-contrast#ffffffText/icon color on top of this color.
--ui-successoklch(71.335% 0.15901 160.899)Success color.
--ui-success-hoverHover state for this color.
--ui-success-contrast#ffffffText/icon color on top of this color.
--ui-warningoklch(0.666 0.179 58.315)Warning color.
--ui-warning-hoverHover state for this color.
--ui-warning-contrast#ffffffText/icon color on top of this color.
--ui-info#2563ebInformational color.
--ui-info-hover#1d4ed8Hover state for this color.
--ui-info-contrast#ffffffText/icon color on top of this color.
--ui-surface#ffffffBase background for panels, cards, and dialogs.
--ui-text#18181bPrimary text color.
--ui-text-muted#71717aSecondary/muted text color.
--ui-border#e4e4e7Default border color.
--ui-border-strong#d4d4d8Stronger border color for emphasized edges.
--ui-overlayrgb(0 0 0 / 0.4)Backdrop color behind modals and dialogs.

Shape

VariableDefaultDescription
--ui-radius10pxBase corner radius for controls (buttons, inputs, badges).
--ui-radius-surfacemin(var(--ui-radius), 1rem)Capped corner radius for large surfaces (panels, cards, tables), so an aggressive radius choice can't turn them into a stadium shape.

Elevation & layering

VariableDefaultDescription
--ui-z-dialog50Stacking order for dialogs.
--ui-z-popover55Stacking order for popovers, menus, and selects.
--ui-z-toast60Stacking order for toasts.
--ui-z-tooltip70Stacking order for tooltips (topmost).
--ui-panel-shadow0 0 0 1px …, 0 8px 24px …, 0 24px 48px …Drop shadow for floating panels.

Motion

VariableDefaultDescription
--ui-ease-outcubic-bezier(0.23, 1, 0.32, 1)Default easing for entering/settling transitions.
--ui-ease-in-outcubic-bezier(0.77, 0, 0.175, 1)Easing for on-screen movement (resize, reposition).
--ui-ease-drawercubic-bezier(0.32, 0.72, 0, 1)Easing for edge-anchored slides (drawers, sheets).
--ui-duration-drawer500msDuration for drawer/sheet slide transitions.
--ui-duration-press160msDuration for press/tap feedback.
--ui-duration-enter200msDuration for enter/open transitions.
--ui-duration-exit150msDuration for exit/close transitions.
--ui-duration-tooltip125msDuration for tooltip open.
--ui-duration-tooltip-exit100msDuration for tooltip close.
--ui-duration-toast400msDuration for toast enter.
--ui-duration-toast-exit200msDuration for toast exit.
--ui-ease-toasteaseEasing for toast transitions.
--ui-toast-offset1remEdge offset for the toast stack.