Skip to content

Headings

The three roles that set titles, in real text, with class, size, line height, tracking and weight on a desktop and on a phone.

Three roles of the type scale set titles: display, heading and title. Each carries its own weight, and the two largest tighten their tracking, so the class by itself is enough.

A role is a size, not a level. The samples here are paragraphs set in a role's class, and which element carries a role (h1, h2) is for the page's outline to decide.

Every screen is set from one scale of seven sizes

DisplayThe title of a page. This site sets its page titles in it.
PropertyDesktopPhone
Size--type-display
24px1.5rem
24px1.5rem
Line height--type-display-leading
32pxcalc(32 / 24)
30px1.25
Tracking--type-display-tracking
-0.015em
-0.015em
Weight--text-2xl--font-weight
500
500

A heading names the part of the page beneath it

HeadingThe step between a section's title and the page's.
PropertyDesktopPhone
Size--type-heading
20px1.25rem
20px1.25rem
Line height--type-heading-leading
28px1.4
26px1.3
Tracking--type-heading-tracking
-0.01em
-0.01em
Weight--text-xl--font-weight
500
500

A title opens a dialog, a card or a section

TitleDialog, card and empty state titles, and this site's section titles.
PropertyDesktopPhone
Size--type-title
16px1rem
16px1rem
Line height--type-title-leading
24px1.5
22pxcalc(22 / 16)
Tracking
None
None
Weight--text-lg--font-weight
500
500

The values in full colour are the ones that apply at this width. The phone values apply where (max-width: 767px) matches.

Wrapping

The item sets text-wrap: balance on h1, h2 and h3, so a title that takes two lines takes two of about the same length.

Classes

The scale keeps Tailwind's names for sizes and gives them its own values. The item clears every size Tailwind ships before it defines its seven, so a class from outside the scale sets no size at all.

The scale
text-2xs 11pxtext-xs 12pxtext-sm 13pxtext-base 14pxtext-lg 16pxtext-xl 20pxtext-2xl 24px
Cleared
--text-*: initial removes every size Tailwind ships. These set nothing:text-3xltext-4xltext-5xltext-6xltext-7xltext-8xltext-9xl
Also a size
text-touchmax(16px, 1rem)A size for the text of a field under a finger. It is not a role.

The heading component

Heading is a Registry component for titles. Two of its sizes are built from the scale's classes and step up with the width of the screen.

Invoices this month

size="card"text-lg md:text-xl lg:text-2xl

Due this week

size="inline"text-base md:text-lg

Not drawn here: display-xl asks for text-[clamp(3.5rem,7.5vw,9rem)]; display asks for text-3xl, text-4xl, text-5xl, text-6xl; section asks for text-3xl, text-4xl, text-5xl. None of those is a class of the scale. How the component's largest sizes should be set is an open point, so they are not shown as part of it.