Skip to content

Divider

The class goes on a plain <hr>. The browser’s own rule has both a border and a height, and both have to be reset before the colour from the tokens is the only one shown. It also has auto margins at the sides, which in a flex column make the line 0 pixels wide. The class resets them, so the line fills the width.

data-variantUsed for
(omitted)An ordinary break between two parts
strongA clear break, for example before a summary
subtleA faint break between rows in a list

<hr> is announced as a break in the content. If the line is only decoration between two boxes that are already visually separate, say that it means nothing:

<hr class="lt-divider" data-variant="subtle" aria-hidden="true" />

If it separates two real parts of the page, it should stay in the accessibility tree. It is then the only way the screen reader learns that a topic has ended.

ClassWhat it is
.lt-dividerThe line. The strength comes from data-variant.
VariableDefault
--lt-divider-spacevar(--lt-spacing-4)

--lt-divider-space is the space above and below the line. See Customising.

  • Do not use a line where a heading belongs. A heading says what is coming; a line only says that something has ended.
  • A line between every item in a list is noise to someone listening to the page. Use aria-hidden="true", or leave it out.