labelStyleVarsfunction
A look as CSS custom properties, to set on the element that holds the labels (element.style.setProperty(name, value)), so a stylesheet can restyle them as well.
Import it
import { labelStyleVars } from "@johnmorrisdotca/hoshi-stars/sky-labels";
Definition
function labelStyleVars(style?: Partial<LabelStyle>): Record<string, string>
Parameters
| Name | Type | Description |
|---|---|---|
style (optional) | Partial<LabelStyle> | A complete or partial look. |
Returns
Record<string, string>
The property names (--hoshi-label-size) with their values as text.
Examples
import { labelStyleVars } from "@johnmorrisdotca/hoshi-stars/sky-labels";
console.log(labelStyleVars({ size: 14 })["--hoshi-label-size"]);14What it prints (run when this page was built)