sdxc

Type to search, or start from one of these:

typography

font-family

Applies font-family from the named font scale (sans, serif, mono, or an app-extended name) via var(--ui-font-{name}, fallback).

import { font } from "@sdxc/u/typography";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.font("serif")css({ fontFamily: "var(--ui-font-serif, ui-serif, Georgia, serif)" })
u.font("inherit")css({ fontFamily: "inherit" })

Using a custom value

Every scale argument also takes a raw CSS value, which passes through untouched.

u.font("serif")

Applying on a state

Wrap the call in a state utility to scope it to one selector.

u.hover(u.font("serif"))

Responsive design

Wrap the call in a container query to scope it to one width.

u.at("md", u.font("serif"))

Customizing the theme

The custom properties this utility reads, which a theme redefines.

Variable
--ui-font-
--ui-font-serif

Signature

u.font(name: FontFamilyName | (string & {}))