Reference · Browser table and SVG
clothVarsfunction
A cloth as CSS variables; nothing for a name that is not a cloth, so the defaults stay.
Import it
import { clothVars } from "@johnmorrisdotca/tenka/ui";
Definition
function clothVars(cloth: string | undefined | null): Record<`--tk-${string}`, string>
Parameters
| Name | Type | Description |
|---|---|---|
cloth | string | null | undefined | A built-in cloth name; an unknown name leaves the defaults. |
Returns
Record<`--tk-${string}`, string>
The CSS variables to set on the element, or an empty object.
Examples
import { clothVars } from "@johnmorrisdotca/tenka/ui";
console.log(clothVars("green"));{
'--tk-sea': '#2f5d4a',
'--tk-link': '#f3efe4',
'--tk-accent': '#2f5d4a',
'--tk-accent-ink': '#f3efe4'
}What it prints (run when this page was built)