labelStyleVars関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { labelStyleVars } from "@johnmorrisdotca/hoshi-stars/sky-labels";
定義
function labelStyleVars(style?: Partial<LabelStyle>): Record<string, string>
引数
| 名前 | 型 | 説明 |
|---|---|---|
style (省略可) | Partial<LabelStyle> | A complete or partial look. |
戻り値
Record<string, string>
The property names (--hoshi-label-size) with their values as text.
例
import { labelStyleVars } from "@johnmorrisdotca/hoshi-stars/sky-labels";
console.log(labelStyleVars({ size: 14 })["--hoshi-label-size"]);14出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。