Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · /bind

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

NameTypeDescription
styleRecord<string, string>

A style from boxStyle.

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")); // true
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.