Overview
stylesheet() creates a feature-scoped sheet. Call it at module level, define class maps with css({ … }), then mount() so the sheet enters the document via adopted stylesheets.
mount() inside a component outer function ties ref-counted mount/unmount to that host. At module level it injects immediately (scripts / benches).
globalCSS shares one document sheet with microtask mount — good for tiny utilities. Theme tokens live on theme / rootCSS.
stylesheet vs globalCSS
|
API
|
Lifetime
|
Prefer when
|
|---|---|---|
stylesheet()
| Ref-counted mount | Feature / page co-located styles |
globalCSS()
| Document singleton | Tiny shared utilities (sr-only, …) |
mount() in outer function
Sheet lifetime follows the host component.
Instance keyframes()
Scoped @keyframes name used in a css() animation property.