vael-ui v0.5.7

Using with Tailwind

vael-ui ships in @layer ui-components. Tailwind v4 puts its utilities in a layer too, so import order matters. Import vael-ui’s CSS before your Tailwind entry, as shown below, so its layer registers first. Tailwind’s utilities then come later in the cascade, and a Tailwind utility on a vael-ui component always wins, with no !important or specificity fights. See Styling and cascade layers for how layers work.

import 'vael-ui/layers.css'
import './style.css' // your Tailwind entry

Keep this import first

Each component loads its own CSS, so vael-ui needs no stylesheet import, except with Tailwind v4. Its utilities live in their own cascade layer, and the first stylesheet that names a layer sets the order. Import vael-ui/layers.css before your Tailwind entry, in your app’s main entry file. It only names vael-ui’s layer and loads no component CSS, so the order holds as components load their CSS later.

Merging classes with tailwind-merge

Every component takes a ui prop for part classes, such as :ui="{ root: 'my-class' }". To resolve conflicting Tailwind utilities there the way tailwind-merge does, where the last one wins per property, set it up once:

import { twMerge } from 'tailwind-merge'
import { ConfigProvider } from 'vael-ui'
<ConfigProvider :class-merge="twMerge">
  <YourApp />
</ConfigProvider>

Every ui.* part class in the tree now goes through twMerge.