TS CSSVars - API ReferenceDocs


TS CSSVars - API Reference / CssVarContext

Interface: CssVarContext<T>

The css variables context created from a string containig the raw variable definitions.

Type Parameters

T extends string

Properties

cssvar()

cssvar: <K>(varname) => `var(–${K})`

Type Parameters

K extends string

Parameters

varname: K

the css variable name

Returns

`var(–${K})`

a css var(..) function of a var

Defined in

lib/makeCssVars.ts:33


definitions

definitions: T

The css variables as a raw definition string.

Defined in

lib/makeCssVars.ts:37


overwrite()

overwrite: <K, V>(varname, value) => `–${K}: ${V};`

Type Parameters

K extends string

V extends string | number

Parameters

varname: K

the css variable name

value: V

the new value to assign to the css variable

Returns

`–${K}: ${V};`

a raw string of the css variable definition of the overwrite

Defined in

lib/makeCssVars.ts:62