font-family

Class Description

font-family

Sets font-family via --font-family. E.g. "Georgia", serif.

CSS Rules

.font-family {
  font-family: var(--font-family);
}

Usage

The .font-family class is flagged as a value-driven selector. The variable --font-family is required.
<element class="font-family" style="--font-family: /* value */;" />

Responsive

Prefix .font-family utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:font-family" style="--md-font-family: /* value */;" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="font-family:hover" style="--font-family-hover: /* value */;" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="font-family:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before font-family::before" style="--font-family-before: /* value */;" />

<element class="content-after font-family::after" style="--font-family-after: /* value */;" />

Shorthand

Value-driven classes support a shorthand syntax like bg=pink or p=4. The runtime processes this for you. Unlike :hover that is generating CSS on the fly, shorthand only splits it and appends the corresponding style.

<!-- Input -->
<element class="font-family=value" />

<!-- Output -->
<element class="font-family" style="--font-family: value;" />

CLS Alert

This feature may cause CLS (Cumulative Layout Shift). Make sure to include a z-not-ready class in your <head> tag.

.font-family Sets font-family via --font-family. E.g. "Georgia", serif.

font-mono

Applies the configured monospace font stack. Good for code.

CSS Rules

.font-mono {
  font-family: var(--font-family-mono);
}

Usage

<element class="font-mono" />

Responsive

Prefix .font-mono utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:font-mono" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="font-mono:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="font-mono:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before font-mono::before" />

<element class="content-after font-mono::after" />
.font-mono Applies the configured monospace font stack. Good for code.

font-sans

Applies the configured sans-serif font stack.

CSS Rules

.font-sans {
  font-family: var({var});
}

Usage

<element class="font-sans" />

Responsive

Prefix .font-sans utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:font-sans" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="font-sans:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="font-sans:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before font-sans::before" />

<element class="content-after font-sans::after" />
.font-sans Applies the configured sans-serif font stack.

font-serif

Applies the configured serif font stack.

CSS Rules

.font-serif {
  font-family: var(--font-family-serif);
}

Usage

<element class="font-serif" />

Responsive

Prefix .font-serif utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:font-serif" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="font-serif:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="font-serif:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before font-serif::before" />

<element class="content-after font-serif::after" />
.font-serif Applies the configured serif font stack.