styleText関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
boxStyle as the text of a style attribute, for a framework that takes a string (Svelte) or a template.
インポート
import { styleText } from "@johnmorrisdotca/hata/bind";
定義
function styleText(style: Record<string, string>): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
style | Record<string, string> | A style from |
戻り値
string
display:inline-block;height:48px;…, empty values left out.
例
import { boxStyle, styleText } from "@johnmorrisdotca/hata/bind";
console.log(styleText(boxStyle({ code: "JP", size: 24 }, 1.5)).includes("height:24px")); // truetrue出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。