Options for CSS injection

interface InjectOptions {
    attributes?: Record<string, string>;
    container?: string;
    prepend?: boolean;
    singleTag?: boolean;
    treeshakeable?: boolean;
}

Properties

attributes?: Record<string, string>

Set attributes of injected <style> tag(s)

  • ex.: {"id":"global"}
container?: string

Container for <style> tag(s) injection

"head"
prepend?: boolean

Insert <style> tag(s) to the beginning of the container

false
singleTag?: boolean

Inject CSS into single <style> tag only

false
treeshakeable?: boolean

Makes injector treeshakeable, as it is only called when either classes are referenced directly, or inject function is called from the default export.

Incompatible with namedExports option.