TypographyWriting Mode

Writing Mode

Sets whether lines of text are laid out horizontally or vertically.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
wm-htbwriting-mode: horizontal-tb;
wm-slrwriting-mode: sideways-lr;
wm-srlwriting-mode: sideways-rl;
wm-vlrwriting-mode: vertical-lr;
wm-vrlwriting-mode: vertical-rl;

Horizontal Top to Bottom

Lines of text are laid out horizontally, read from top to bottom. This is the default writing mode.

Sphinx of black quartz, judge my vow.

<div class="fs-md wm-htb c-slate">
<p>Sphinx of black quartz, judge my vow.</p>
</div>

Vertical Right to Left

Lines of text are laid out vertically, read from right to left.

Sphinx of black quartz, judge my vow.

<div class="fs-md wm-vrl c-slate h-32">
<p>Sphinx of black quartz, judge my vow.</p>
</div>

Vertical Left to Right

Lines of text are laid out vertically, read from left to right.

Sphinx of black quartz, judge my vow.

<div class="fs-md wm-vlr c-slate h-32">
<p>Sphinx of black quartz, judge my vow.</p>
</div>

Sideways Right to Left

Lines of text are laid out vertically, with characters rotated sideways, read from right to left.

Sphinx of black quartz, judge my vow.

<div class="fs-md wm-srl c-slate h-32">
<p>Sphinx of black quartz, judge my vow.</p>
</div>

Sideways Left to Right

Lines of text are laid out vertically, with characters rotated sideways, read from left to right.

Sphinx of black quartz, judge my vow.

<div class="fs-md wm-slr c-slate h-32">
<p>Sphinx of black quartz, judge my vow.</p>
</div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:wm-*, md:wm-*, lg:wm-*, and xxl:wm-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:wm-* utility to override elements and change their values when hovering over them.