Skip to main content

Font Family

Set the font family for an element.

View as Markdown
baselinewidely
ClassCSS
ff:dfont-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Noto Sans, Liberation Sans, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
ff:mfont-family: ui-monospace, Cascadia Code, Source Code Pro, Menlo, Roboto Mono, Ubuntu Mono, Consolas, Liberation Mono, Courier New, monospace;
ff:sfont-family: Iowan Old Style, Palatino Linotype, URW Palladio L, P052, serif;

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:ff:m.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:ff:mFrom 32rem up.
@sm:ff:mFrom 40rem up.
@md:ff:mFrom 48rem up.
@lg:ff:mFrom 64rem up.
@xl:ff:mFrom 80rem up.
@xxl:ff:mFrom 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:ff:mContainer from 32rem up.
@c:sm:ff:mContainer from 40rem up.
@c:md:ff:mContainer from 48rem up.
@c:lg:ff:mContainer from 64rem up.
@c:xl:ff:mContainer from 80rem up.
@c:xxl:ff:mContainer from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:ff:mOn a touch screen.
@prm:ff:mWith reduced motion on.
@st:ff:mOn the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:ff:mOn :hover.
f:ff:mOn :focus.
fv:ff:mOn :focus-visible.
a:ff:mOn :active.
d:ff:mOn :disabled.
fc:ff:mOn :first-child.
c:ff:mOn :checked.
e:ff:mOn :empty.
fw:ff:mOn :focus-within.
i:ff:mOn :invalid.
in:ff:mOn :indeterminate.
lc:ff:mOn :last-child.
nc:ff:mOn :nth-child.
r:ff:mOn :required.
ro:ff:mOn :read-only.
v:ff:mOn :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::ff:mOn ::after.
b::ff:mOn ::before.
p::ff:mOn ::placeholder.
s::ff:mOn ::selection.

Custom Fonts

Add a font stack in theme.fonts & use it by name. A name that matches a built-in family (d, m, s) replaces it.

yumma.config.mjs
import { defineConfig } from "yummacss";
export default defineConfig({ theme: { fonts: { display: '"Esteban", serif', }, },});
<h1 className="ff:display fs:3xl">Documents</h1>