Reference · Rolls and exact odds
clothVarsfunction
A cloth as the tray's CSS variables; nothing for a name that is not a cloth, so the tray keeps its own.
Import it
import { clothVars } from "@johnmorrisdotca/korokoro";
Definition
function clothVars(cloth: string | undefined | null): Record<`--kk-${string}`, string>
Parameters
| Name | Type | Description |
|---|---|---|
cloth | string | null | undefined | A built-in cloth name; an unknown name leaves the tray defaults. |
Returns
Record<`--kk-${string}`, string>
A cloth as the tray's CSS variables; nothing for a name that is not a cloth, so the tray keeps its own.
Examples
import { clothVars } from "@johnmorrisdotca/korokoro";
console.log(clothVars("green"));{
'--kk-felt': '#2f5d4a',
'--kk-felt-deep': '#1f4135',
'--kk-felt-ink': '#f3efe4'
}What it prints (run when this page was built)