styleTextfunction
boxStyle as the text of a style attribute, for a framework that takes a string (Svelte) or a template.
Import it
import { styleText } from "@johnmorrisdotca/hata/bind";
Definition
function styleText(style: Record<string, string>): string
Parameters
| Name | Type | Description |
|---|---|---|
style | Record<string, string> | A style from |
Returns
string
display:inline-block;height:48px;…, empty values left out.
Examples
import { boxStyle, styleText } from "@johnmorrisdotca/hata/bind";
console.log(styleText(boxStyle({ code: "JP", size: 24 }, 1.5)).includes("height:24px")); // truetrueWhat it prints (run when this page was built)