font-smoothing

Class Description

antialiased

Enables antialiased font smoothing.

CSS Rules

.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: antialiased;
}

Usage

<element class="antialiased" />

Responsive

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

<element class="md:antialiased" />

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="antialiased: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="antialiased: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 antialiased::before" />

<element class="content-after antialiased::after" />
.antialiased Enables antialiased font smoothing.

subpixel-antialiased

Sets font smoothing to the browser's default (auto) subpixel-antialiased rendering.

CSS Rules

.subpixel-antialiased {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

Usage

<element class="subpixel-antialiased" />

Responsive

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

<element class="md:subpixel-antialiased" />

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="subpixel-antialiased: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="subpixel-antialiased: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 subpixel-antialiased::before" />

<element class="content-after subpixel-antialiased::after" />
.subpixel-antialiased Sets font smoothing to the browser's default (auto) subpixel-antialiased rendering.