Getting started

CSS reference

Use the stable CSS entries, variables, and semantic data hooks without depending on internal wrapper order.

View as Markdown

The public CSS contract consists of package CSS entries, custom properties, and semantic data attributes. Internal wrapper order is not part of the contract.

CSS entry points

css
import "velvet-ui/sheet.css";             // Sheet/Scroll mechanics only
import "velvet-ui/toast.css";             // Toaster mechanics only
import "velvet-ui/toast-theme.css";       // Toaster mechanics + default skin
import "velvet-ui/base.css";              // common Sheet + Toaster mechanics
import "velvet-ui/styles.css";            // mechanics + every supplied skin
import "velvet-ui/bottom-sheet.css";       // one composition
import "velvet-ui/card-expansion.css";
import "velvet-ui/depth-sheet.css";
import "velvet-ui/lightbox.css";
import "velvet-ui/persistent-sheet.css";

Core and Panel variables

VariableDefaultScope
--velvet-100lvh100dvh when supportedVisible viewport height
--velvet-z-sheet100Sheet portal layer
--velvet-z-toast9999Toast layer
--velvet-panel-background#fffSheet.Panel skin
--velvet-panel-foreground#171923Sheet.Panel text
--velvet-panel-radius24pxStandard radius
--velvet-panel-padding20pxStandard padding
--velvet-panel-shadowlayered shadowStandard elevation
--velvet-backdrop-backgroundtransparent in baseBackdrop color
--velvet-handle-backgroundcurrent-color mixHandle color

Bottom and Persistent Sheet defaults

Variable suffixBottom SheetPersistent Sheet
max-width720px720px
inset16px16px
max-height760px720px
top-gap24px24px
radius28px, 24px at 520pxsame
background#fff#fff
foreground#111827#111827
content-top48px46px
content-inline24px24px
content-bottommax of 24px and safe areasame
handlergb(17 24 39 / .2)same
backdrop#000no backdrop by default

Prefix the suffix with --velvet-bottom-sheet- or --velvet-persistent-sheet-. Both expose a shadow variable with the layered composition elevation as its default.

Card, Lightbox, and Toast defaults

VariableDefault
--velvet-card-expansion-widthmin(720px, 100vw - 32px)
--velvet-card-expansion-heightmin(820px, 100dvh - 40px)
--velvet-card-expansion-radius28px
--velvet-card-expansion-background#fff
--velvet-card-expansion-foreground#111827
--velvet-card-expansion-backdrop#000
--velvet-lightbox-inset20px, 12px at 520px
--velvet-lightbox-foreground#fff
--velvet-lightbox-surface#000
--velvet-lightbox-backdrop#000
--velvet-toast-width360px
--velvet-toast-offset24px
--velvet-toast-stack-gap14px
--velvet-toast-content-gap12px
--velvet-toast-radius15px
--velvet-toast-easecubic-bezier(.22, 1, .36, 1)

Override composition tokens

css
[data-velvet-depth="root"] {
  --velvet-depth-inset: max(20px, env(safe-area-inset-top));
  --velvet-depth-radius: 30px;
  --velvet-depth-surface-background: #f8f7f4;
}

[data-velvet-card-expansion="content"] {
  --velvet-card-expansion-width: min(760px, calc(100vw - 32px));
}

Depth Sheet's full token table, including bounded ten-level stacking behavior, is in Composition API.

Stable data hooks

HookMeaning
[data-velvet="view"]Fixed sheet host
[data-velvet="backdrop"]Interactive backdrop
[data-velvet="content"]Authored sheet surface
[data-velvet="handle"]Drag and step control
[data-velvet-placement]top, right, bottom, left, or center
[data-velvet-modal]Current modality
[data-velvet-scroll="view"]Coordinated content scroller
[data-velvet-depth]Depth composition part
[data-slot="toaster"], [data-slot="toast"]Toast structure

Style semantic hooks, not generated ids or internal spacer nodes. Scroll track attributes are structural and may change without a visual API change.