Skip to main content
U.S. Flag

An official website of the United States government

Typography

Notice:

Typography sizing updates!

We've updated typography sizing variables and class names to make them more agnostic. Read about how you can update.

Headings

The design system doesn't style base HTML typography elements (like h1, h2, p, etc) in order to avoid conflicting with any existing site styles. You should instead use one of the base typography classes below to apply styling:

.ds-text-heading--5xl

We the People of the United States

.ds-text-heading--4xl

We the People of the United States

.ds-text-heading--3xl

We the People of the United States

.ds-text-heading--2xl

We the People of the United States

.ds-text-heading--xl

We the People of the United States

.ds-text-heading--lg

We the People of the United States

.ds-text-heading--md

We the People of the United States

.ds-text-heading--sm

We the People of the United States

Body

.ds-text-body--lg

We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.

.ds-text-body--md

We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.

.ds-text-body--sm

We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.

List

Lists organize written information for users.

When to use

  • Use an ordered list when you need to display text in some ranking, hierarchy, or series of steps.
  • Use unordered lists to display text in no specific order.

When to consider alternatives

  • If you need to communicate long lists of narrative text.

Usage

  • Use sentence case and begin lists with a capital letter.
  • Use punctuation appropriate to the text. Do not leave sentences without periods.

Accessibility

  • When a list has a heading, consider adding an id attribute to the heading element, and an aria-labelledby attribute to the list element. Screen readers will then announce the heading text when users navigate to the list.
  • When using an unstyled list, role="list" should be added to the list element.

Learn more

Unordered list

.ds-c-list
  • List item 1
  • List item 2

Ordered list

.ds-c-list
  1. List item 1
  2. List item 2
Warning:

It's worth mentioning that when list-style is removed from a list, Safari will not recognize it as a list in the accessibility tree.

To resolve this issue, role="list" should be added to a list where the styles have been removed.

Unstyled list

.ds-c-list .ds-c-list--bare
  • List item 1
  • List item 2

Links connect users to a different page or further information.

The only base HTML element the design system applies styling to is the <a> element. You can also use .ds-c-link and .ds-c-link--inverse for styling links.

When to use

  • Navigating to a new page or view in your application
  • Navigating to a different web page, e.g. external documentation
  • Note: Warn the user if links open a new window or downloads a file (PDF, for example).

When to consider alternatives

  • Opening or closing a modal or dialog
  • Triggering a dropdown menu
  • Submitting data to the server

Your link should always describe where it will take users. Users tend to scan text online, and elements that stand out (like links) grab attention. Clear links can help users navigate more quickly.

For example, instead of:

Learn more

Use:

Learn how to reset your passphrase

Never use a link to say “click here.” A nondescript link forces users to backtrack and read the surrounding text for more context. This is even more problematic for those who rely on screen readers, which can list links for quicker navigation. A list of “click here” isn’t helpful for anyone.

Accessibility

  • Users should be able to tab to navigate between links.
  • Users should be able to activate a link when pressing ‘Enter’ on their keyboard.
  • Users should be able to identify links without relying on color alone.
  • Users should be able to activate hover and focus states with both a mouse and a keyboard.

This is a text link on a light background.

This is a visited link.

This is a text link on a dark background.

This is a visited link on a dark background.

Responsive typography

The .ds-type-heading-3xl, ds-type-heading-2xl, and ds-type-heading-xl classes are responsive by default. To apply responsive typography elsewhere, use the font size utility class. Since the base typography margins and line height is measured in em units, they'll automatically adjust as you change the font size.

Customization

The following Sass variables can be overridden to change the type sizes:

  • $font-size-5xl
  • $font-size-4xl
  • $font-size-3xl
  • $font-size-2xl
  • $font-size-xl
  • $font-size-lg
  • $font-size-md, uses $base-font-size
  • $font-size-sm