CSS variables and global CSS
Understand the theme CSS boundary, global rules, and the small set of cases where custom CSS is justified.
Theme variables
The theme owns the variables consumed by components. Consumers should use semantic props instead of depending on generated variable names.
tsx
<Box background="surface2" color="text" />Global CSS
The default Whisk/UI stylesheet includes Preflight, which resets browser defaults and applies semantic body typography and colors. Use global CSS only for additional document-level rules such as font loading or selection. If your host owns its reset, import the split foundation and component styles instead.
ts
import "@smoothie-framework/whisk-styles/styles.css";
// Host-owned reset:
import "@smoothie-framework/whisk-styles/styles/foundation";
import "@smoothie-framework/whisk-styles/styles/components";Keep CSS at the boundary
Custom CSS is justified when no component prop or theme primitive represents the behavior—for example, a host integration rule such as position relative.