Skip to content

Typography

The Cosmic theme offers a set of class names that can be applied to text to give it a particular visual style.

Visit our Design and Layout page to learn why we limit our UO web fonts to United Sans Regular, United Serif Regular, and Source Sans Variable.

These text size classes can be useful when you need text to be visually larger (like a header style), but without changing the HTML tags that wrap an element. All text in the Cosmic theme is based off of these sizes, so if you ever need text to “look like” the text used in another component, you can simply apply one of these classes to your component to achieve the same font design.

TokenCustom Property (Font Size)Custom Property (Line Height)Value (Font Size)Value (Line Height)Utility ClassExample
Extra Small—text-size—xs—line-height—xs0.875rem (14px)1.225remuo-text-size--xsXS Size Text
Small—text-size—sm—line-height—sm1rem (16px)1.4remuo-text-size--smSmall Size Text
Regular—text-size—rg—line-height—rg1.125rem (18px)1.575remuo-text-size--rgRegular Size Text
Regular (Extra)—text-size—ex—line-height—ex1.25rem (20px)1.75rem (28px)uo-text-size--exRegular (Extra) Size Text
Medium—text-size—md—line-height—md1.5rem (24px)1.65remuo-text-size--mdMedium Size Text
Large—text-size—lg—line-height—lg1.75rem (28px)1.9remuo-text-size--lgLarge Size Text
Extra Large—text-size—xl—line-height—xl2rem (32px)2.2remuo-text-size--xlXL Size Text
2XL—text-size—2xl—line-height—2xl2.5rem (40px)2.5remuo-text-size--2xl2XL Size Text
3XL—text-size—3xl—line-height—3xl3.125rem (50px)3remuo-text-size--3xl3XL Size Text
4XL—text-size—4xl—line-height—4xl3.75rem (60px)3.5remuo-text-size--4xl4XL Size Text
5XL—text-size—5xl—line-height—5xl5.625rem (90px)5.35remuo-text-size--5xl5XL Size Text

Each text size also includes a “fluid” version which will shrink down a bit on mobile to adapt better to the smaller screen size.

Utility ClassExample
uo-text-size-fluid--xsThis is fluid xs text. This is fluid xs semibold text. This is fluid xs bold text.
uo-text-size-fluid--smThis is fluid sm text. This is fluid sm semibold text. This is fluid sm bold text.
uo-text-size-fluid--rgThis is fluid rg text. This is fluid rg semibold text. This is fluid rg bold text.
uo-text-size-fluid--mdThis is fluid md text. This is fluid md semibold text. This is fluid md bold text.
uo-text-size-fluid--lgThis is fluid lg text. This is fluid lg semibold text. This is fluid lg bold text.
uo-text-size-fluid--xlThis is fluid xl text. This is fluid xl semibold text. This is fluid xl bold text.
uo-text-size-fluid--2xlThis is fluid 2xl text. This is fluid 2xl semibold text. This is fluid 2xl bold text.
uo-text-size-fluid--3xlThis is fluid 3xl text. This is fluid 3xl semibold text. This is v3xl bold text.
uo-text-size-fluid--4xlThis is fluid 4xl text. This is fluid 4xl semibold text. This is fluid 4xl bold text.
uo-text-size-fluid--5xlThis is fluid 5xl text. This is fluid 5xl semibold text. This is fluid 5xl bold text.

If you need the text to look like a header (h1-h6) tag, without using that tag (or to adjust text within one of those tags to look like another visually), you can use the following classes to make the text visually behave like a header.

Utility ClassExample
uo-text-header-1H1. Main Header
uo-text-header-2H2. Header
uo-text-header-3H3. Header
uo-text-header-4H4. Header
uo-text-header-5H5. Header
uo-text-header-6H6. Header

While the header styles are fluid by default, each header class also has an accompanying fixed variant if you do not want it to change size on smaller screens.

Utility ClassExample
uo-text-header-1--fixedH1. Main Header (Fixed Size)
uo-text-header-2--fixedH2. Header (Fixed Size)
uo-text-header-3--fixedH3. Header (Fixed Size)
uo-text-header-4--fixedH4. Header (Fixed Size)
uo-text-header-5--fixedH5. Header (Fixed Size)
uo-text-header-6--fixedH6. Header (Fixed Size)

Visit the Text page to learn about using headers to improve page layouts and increase accessibility.

There are several classes to adjust the weight of the text, from extra light, to bold, to heavy.

TokenCustom Property (font-variation-settings)Custom Property (font-weight)ValueUtility ClassExample
Extra-Light—font-ext-light—font-weight-ext-light100uo-text-weight--ext-lightAn Example of Extra-Light Weight Text
Light—font-light—font-weight-light300uo-text-weight--lightAn Example of Light Weight Text
Regular (Default)—font-reg—font-weight-reg350uo-text-weight--regAn Example of Regular Weight Text
Semi-Bold—font-semi—font-weight-semi500uo-text-weight--semiAn Example of Semi-Bold Weight Text
Medium—font-med—font-weight-med600uo-text-weight--medAn Example of Medium Weight Text
Bold—font-bold—font-weight-bold700uo-text-weight--boldAn Example of Bold Weight Text
Extra-Bold—font-ext-bold—font-weight-ext-bold800uo-text-weight--ext-boldAn Example of Extra-Bold Weight Text
Heavy—font-heavy—font-weight-heavy900uo-text-weight--heavyAn Example of Heavy Weight Text

If you need to adjust the style of a font to be italic (without wrapping it in an em tag), or if you need all-caps text visually, you can use the following styles. If you need text to NOT be italic, you can apply the uo-text-style—reg class to it if you need to override a default italic style.

Utility ClassExample
uo-text-style--italicThis is italic text
uo-text-style--all-capsThis is all-caps text
uo-text-style--title-caseThis is title case text
uo-text-style--regThis is regular text (used to undo any text variants that exists)

If you have a context where you need text to be a particular font family type (serif, sans-serif, slab or slab sans-serif), you can apply the following classes to change the font display. This should be limited to use-cases when you need to adjust the font-family for a custom designed or tweaked element, and should NOT be used to change the font for a whole page or standard body copy.

TokenCustom PropertyValueUtility ClassExample
Sans Serif—font-family-sans”Source Sans Variable”, Arial, Helvetica, Verdana, sans-serifuo-text-font--sansSans Serif Text
United Sans Serif—font-family-sans-united”United Sans”, “Source Sans Variable”, Arial, Helvetica, Verdana, sans-serifuo-text-font--sans-unitedUnited Sans Serif Text
United Sans Semi-Condensed—font-family-sans-united-semi”United Sans Semi-Condensed”, “Source Sans Variable”, Arial, Helvetica, Verdana, sans-serifuo-text-font--sans-united-semiUnited Sans Semi-Condensed Text
Source Serif—font-family-serif”Source Serif Variable”, Times, “Times New Roman”, Georgia, “DejaVu Serif”, serifuo-text-font--serifSource Serif Text
United Serif—font-family-slab”United Serif”, “Source Serif Variable”, Times, Georgia, “DejaVu Serif”, serifuo-text-font--slabUnited Serif
United Serif Light—font-family-slab-light”United Serif”, “Source Serif Variable”, Times, Georgia, “DejaVu Serif”, serifuo-text-font--slab-lightUnited Serif
Monospace—font-family-monospace”Courier New”, “DejaVu Sans Mono”, monospace, sans-serif