Skip to content
Browse documentation
whisk/ui

Custom CSS

Use application CSS only for integration boundaries that Whisk/UI utility props and recipes do not cover.

CSS boundary

Use the shared utility vocabulary first, then a recipe for finite custom CSS, and host CSS for integration-only rules.

  • Use component props for layout and values in the Whisk/UI utility contract.
  • Use a recipe for a reusable custom declaration, selector, or media query.
  • Use host CSS for a third-party integration or browser behavior outside both APIs.

For reusable application patterns with variants, use a component recipe instead.

Host CSS

An integration selector belongs next to the integration, not in a component that already exposes a matching prop.

map-provider.css
/* Third-party host markup outside the Whisk/UI component contract. */
.map-provider-control {
  position: absolute;
  inset-inline-end: 1rem;
  inset-block-end: 1rem;
}

Recipe precedence

Compiled Whisk styles use named reset, default, library, and application layers.

Whisk establishes whisk.reset, whisk.defaults, whisk.library, and whisk.application, in that order. Application recipes use whisk.application by default and override library recipes. Unlayered host CSS still overrides those layers, so keep it intentional and local.

app.css
@layer whisk.application {
  .smth-product-notice {
    max-width: 42rem;
  }
}