Reference · Game engine and table
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/hitotsu";
Definition
function clothVars(cloth: string | undefined | null): Record<`--ht-${string}`, string>
Parameters
| Name | Type | Description |
|---|---|---|
cloth | string | null | undefined | A built-in cloth name; an unknown name leaves the defaults. |
Returns
Record<`--ht-${string}`, string>
The CSS variables to set on the element, or an empty object.
Examples
import { clothVars } from "@johnmorrisdotca/hitotsu";
console.log(clothVars("green"));{
'--ht-felt': '#2f5d4a',
'--ht-felt-deep': '#1f4135',
'--ht-felt-ink': '#f3efe4'
}What it prints (run when this page was built)