Skip to content

List

The class goes on <ul> or <ol> and gives the list the right spacing and indentation. The variants remove the bullets visually without removing the list itself. The exception is Safari, where VoiceOver may not read a <ul> without visible bullets as a list. An <ol> and a list inside <nav> keep it. If the count matters to someone listening to the page, set role="list" on the <ul>.

data-variantUsed for
(omitted)Bullets or numbers, with indentation
plainNo bullets, for lists that carry their own structure
dividedNo bullets, with a line between the rows

Without plain, people would write <div> to get rid of the bullets, and the information that this is a list of four items is lost. The variant removes the look, not the meaning, with the Safari exception above.

ClassWhat it is
.lt-listThe list. The variant comes from data-variant.
VariableDefault
--lt-list-gapvar(--lt-spacing-1), and var(--lt-spacing-2) in divided

--lt-list-gap is the space between the items, and becomes the space above and below each row in divided. The two have different defaults, so if you set the variable, your value applies in both places. See Customising.

  • Use <ol> when the order matters, as in a recipe or a sequence of steps in a case. Use <ul> otherwise.
  • Put nothing but <li> directly inside the list. A <div> in between breaks the link between the list and its items.
  • Lists of links should be in a list even when they look like a menu. The screen reader then says how many choices there are.