Skip to main content

keyed_intent_css_vars

Function keyed_intent_css_vars 

Source
pub fn keyed_intent_css_vars(id: &str, tokens: &SemanticTokens) -> String
Expand description

Emit one theme’s intent layer keyed by THEME_ATTRIBUTE, as :root[data-theme="<id>"] { … }.

The attribute selector outranks the bare :root of intent_css_vars, including one inside a media query, so a sheet may carry an ambient-following default and let a pin override it without !important and without ordering games.

id is escaped as the attribute value it becomes, so any string is safe here; one that is not a valid theme id just names no theme.