Skip to content

Heading

Size and level are two different things. The level is <h1> to <h6> and decides the structure screen readers navigate by. data-size only decides how large the text looks.

data-sizeFont
mega--lt-font-size-mega
xl--lt-font-size-xxl
(omitted)--lt-font-size-xl
m--lt-font-size-l
s--lt-font-size-m
xs--lt-font-size-s, in capitals

An <h2> that should look small is correct. An <h4> chosen because it was small enough skips a level, and the table of contents the screen reader builds is then wrong:

<h2 class="lt-heading" data-size="s">Attachments</h2>

The page should have one <h1>, and the levels below should follow each other without skipping.

ClassWhat it is
.lt-headingThe heading. The size comes from data-size.

The sizes are the --lt-font-size tokens directly, so a change to the scale applies everywhere at once. Weight and line height are separate variables, because an organisation adopting the system often has its own typography:

VariableDefault
--lt-heading-font-weightvar(--lt-font-weight-bold)
--lt-heading-line-heightvar(--lt-line-height-heading)

The headings use text-wrap: balance, so a heading over two lines does not end with a single word on the last one.

See Customising for how the layer works.

  • Screen readers can list every heading and jump between them. That is the most common way to find your way around a long page.
  • Do not use a heading to make text large. Use Paragraph with data-size="large".
  • A heading with no content below it is not a heading.