Entry markers
Choose where generated utility CSS is inserted and which package styles are loaded.
Use one entry marker in the stylesheet that should receive generated utility CSS. Choose the full package import for an ordinary application, or the lightweight marker when the package foundation is already loaded elsewhere.
@master entry
Marks the stylesheet as a lightweight Master CSS entry and inserts the generated CSS slot without loading the package stylesheet graph. Use it when a stylesheet should receive generated CSS but should not import the default @master/css stylesheet.
@master entry;@import "@master/css"
Marks the stylesheet as a full Master CSS entry, loads the package stylesheet graph, and includes the default layer and base stylesheet behavior. This is the normal entry marker for app stylesheets.
@import "@master/css";Other directive families such as @settings, @theme, @mode, @custom-variant, @utilities, @source, @reference, @safelist, @blocklist, @compose, @variant, @prune native, and @preserve native are not entry markers by themselves.
Local file URLs
Node file compilation reads CSS import names using CSS escaping and case rules.
Relative @import and @reference URLs resolve their pathname against the source
file: percent escapes identify filename characters, while query strings and
fragments are excluded from the filesystem path. For example,
"./tokens%20%23.css?v=1#theme" reads a sibling file named tokens #.css.
Existing bare relative CSS paths such as "tokens.css" are also expanded. Bare
package imports without a matching local file remain available to the host
resolver. Reference files remain compile-time context and do not emit their native CSS.
For a prepared virtual stylesheet, the host's explicit filesystem source owner
also supplies the base for relative CSS references. Resources in a referenced
definition remain relative to the reference file when composed elsewhere.
Stylesheet boundaries and resource URLs
CSS import conditions and layers apply to the imported stylesheet. Moving or
combining files must preserve those boundaries and the URLs of their images and
fonts. A resource used by an imported managed definition retains that definition's
source location when another file uses it through @compose.
Native CLI project scanning reads global definitions from unqualified imports before resolving @compose. A qualified import may contain native CSS, including native rules with @compose, but cannot contain global Master definitions. Put those definitions in an unqualified import or a separate @reference input.
Relative @source patterns are resolved from the file that declares them, and
@reference supplies composition context without adding its scanning sources or
exporting its managed classes. Reading this metadata does not publish stylesheet
or resource files. CLI file export is a separate delivery step and does publish the required assets.
The prepared-files compiler method compileStylesheets() returns separate CSS
assets and accepts a resourceURLs map for parsed url() and image-set() values.
The map is keyed by source file ID, then by the decoded resource URL; replacements
must be root-relative or absolute. Use absolute replacements when output files
can be served from different origins. All returned stylesheets must be delivered.
Fragment-only references such as url(#filter) remain local references.
This prepared-files method requires the host to supply import resolution, resource
mappings and reference context. CLI file export and Vite production builds publish
the required stylesheet and resource assets. Node file and rendered-stylesheet APIs
opt in through their delivery options; their caller must publish every returned
asset. --no-export and calls without delivery options retain their separate
single-output limitations. Without resource mappings, the host must preserve
original URL bases. See CSS imports for the delivery boundaries.
Preparing native CSS for another transformer
Compiler hosts can opt into preserveNativeSource: true when another transformer
needs the untouched native portions of a stylesheet. Master definitions are still
consumed and native @compose rules are still lowered, while unrelated comments,
empty rules, value spelling, and rule boundaries are retained. The option defaults
to false, preserving the compiler's normal native CSS normalization.
Source preservation cannot be combined with enabled native pruning. Passing a class list alone does not enable pruning. preserveNativeCSS: false still suppresses native output. The option
does not prevent subsequent host transforms from optimizing the result or rewriting
its source map, and it does not discover new Master definitions or generated-global
references introduced by a later transform.
Continuing resource rendering after host transforms
compileRenderedStylesheet() and compileBrowserStylesheet() accept an optional
emittedGlobals resource-count snapshot when another output already supplies
generated variables or keyframes. Positive counts suppress duplicate emission;
zero counts do not. New references still emit their transitive resource closure.
The returned snapshot includes the external context and resources required by this
render, without changing the input snapshot. Omitting the option preserves normal
standalone rendering.
This context prevents a later render from replacing an already processed variable with its original manifest value. It does not run host plugins on newly generated CSS. Hosts remain responsible for processing that new CSS and publishing its resources while preserving plugin ordering and source ownership.