Web Compendium Sitemap

Typography

Wrapping & Breaking

The hyphens property specifies how words are hyphenated: not at all, manually, or automatically by the browser. Automatic hyphenation requires the lang attribute [MDN] to be set. Manual hyphenation occurs when the soft hyphen character ­ is inserted into the words that should break. [MDN]

Styling of inline elements that break across multiple lines is sometimes not ideal. For example, the border-radius is only applied on both the start and the end of an element. But it is not applied at line breaks by default. This behaviour can be configured with box-decoration-break. [MDN]

Widows and Orphans

A widow is a paragraph-ending line that falls at the beginning of the following page or column, thus separated from the rest of the text. An orphan is a paragraph-opening line that appears by itself at the bottom of a page or column, thus separated from the rest of the text. [...] Alternately, a word, part of a word, or very short line that appears by itself at the end of a paragraph. [Wikipedia]

text-wrap: balance may be used to avoid orphans in some cases (for example in headings) [spec].

Fonts

System Font Stack

Custom Fonts

FOUT, FOIT

Custom fonts have to be loaded before they can be applied. That leads to an annoying effect where the actual text has already been retrieved by the browser, but the font is still being loaded. Browsers may apply different strategies to handle that situation.

Using font-display, it can be configured if and how fallback and custom fonts should be applied to text [MDN].

To reduce the effects of FOUT, it may be an idea to style the websafe/fallback font as similarly as possible to how the custom font will look once it loaded. This works by adapting the various CSS text styles accordingly. There are tools available to simplify that. [meowni.ca, screenspan.net]

It is possible to detect when a custom font has finished loading. When using @font-face, you can use third-party tools for that [bramstein/fontfaceobserver]. But you can also load fonts programmatically with FontFace and then use FontFace.loaded to verify that [MDN].

Variable Fonts

developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide

Color Fonts

The OpenType font format supports multicolored glyphs. Of the four different standards OpenType-SVG, COLR, SBIX, and CBDT/CBLC, only COLR is (currently) relevant for the web. COLRv0 only supports solid colors [caniuse]. The newer COLRv1 additionally supports gradients and other graphic operations [caniuse]. [Wikipedia, css-tricks.com, webkit.org]