{css:reserved:css}

Description

Registers a block of CSS to be emitted into the page HEAD. The stylesheet you pass is collected during page expansion and printed as a style element at the position marked by the generate HEAD command (the same mechanism the require command uses for JavaScript and external libraries). The expression itself outputs nothing at the call site - it always returns an empty string - so it is safe to place anywhere in a template or view without disturbing the surrounding text. The first parameter is reserved for future use (intended for CSS priority or layer) and is currently ignored; the actual stylesheet is the second parameter. With only one segment the value lands in the reserved slot and nothing is registered, so always keep the leading colon. Requires the page to include the generate HEAD marker for the style block to appear.

Parameters

reserved optional

Reserved for future use - intended to carry the CSS priority or layer. The engine currently ignores it. Keep it present (even as an empty slot or a 0) so the stylesheet ends up in the second parameter.

css required

The stylesheet text. When non-empty it is registered and emitted into the page HEAD as a <style> block at the position marked by {generate:HEAD}. The expression itself returns an empty string at the call site.

Examples

test[{css:0:.news-list { color: green; }}]
Expected[]
Actual[]
Typical use. The stylesheet is registered for the page HEAD (emitted where {generate:HEAD} sits); the call itself prints nothing, so the surrounding output is empty.
testbefore{css:0:.card { margin: 0; }}after
Expectedbeforeafter
Actualbeforeafter
Because {css:} returns an empty string inline, it never disturbs the text around it - only the HEAD style block is affected.
test[{css:print:.note { display: none; }}]
Expected[]
Actual[]
The first parameter is reserved for future use (intended for CSS priority or layer). It is currently ignored, so the value you put there has no effect; the stylesheet still comes from the second parameter.
test[{css:.x { color: red; }}]
Expected[]
Actual[]
Trap: with only one segment the value lands in the reserved first parameter and the stylesheet stays empty, so nothing is registered. Always keep the leading colon - write {css::.x { color: red; }} (empty reserved slot) or {css:0:.x { color: red; }}.
test[{css:}]
Expected[]
Actual[]
An empty or missing stylesheet registers nothing and raises no error; the call simply returns an empty string.