Lists
Style modifiers for HTML ordered <ol> , unordered <ul> and definition <dl> lists.
Examples (anchor)
The default list styles provided with the typography also include CSS variables to customize basic list property values in real-time, see the typography source code.
Ordered and unordered lists (anchor)
Unstyled (anchor)
<ol class="ol-none">
- Item 1
- Item 2
- Item 3
- Item 4
<ul class="ul-none">
- Item 1
- Item 2
- Item 3
- Item 4
Inline lists (anchor)
<ol class="ol-inline">
- Item 1
- Item 2
- Item 3
- Item 4
<ul class="ul-inline">
- Item 1
- Item 2
- Item 3
- Item 4
<ul class="ul-inline" style="--gap: 2rem;">
- Item 1
- Item 2
- Item 3
- Item 4
Comma list (anchor)
<ul class="list-comma">
- Item 1
- Item 2
- Item 3
- Item 4
Dividers (anchor)
<ul class="list-divider">
<ul class="list-divider" style="--divider: '/';">
<ul class="list-divider" style="--divider: '>';">
The divider spacing uses padding values and can also be adjusted inline:
<ul class="list-divider" style="--divider-px: 1rem;">
Definition lists (anchor)
Bold term (anchor)
<dl class="dt-bold">
- Term 1
- Description 1
- Description 2
- Term 2
- Description 1
- Description 2
Unstyled (anchor)
<dl class="dl-none">
- Term 1
- Description 1
- Description 2
- Term 2
- Description 1
- Description 2
Meta list (anchor)
<dl class="dl-meta">
<dl class="dl-meta dt-bold">
<dl class="dl-meta" style="--dl-meta-gap: 1.5rem;">
<dl class="dl-meta dt-bold" style="--dt-colon: '';">
Comma lists (anchor)
<dl class="dl-comma">
<dl class="dl-comma-inline">
Using the module (anchor)
Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.
@use "stylemods/scss" as *;
@include lists-css;See the using modules page for more information.
Using the framework (anchor)
Using the recommended custom setup enable the styles in an overrides document:
@use "stylemods/scss/configuration" as *;
$enable-lists: true;Include the overrides and the framework styles with your custom document for compiling the framework:
@use "overrides";
@use "stylemods/scss/stylemods";See using the framework for more information.
Source code (anchor)
The Lists source file is included with the utilities module files, you can view the source code from the latest release (v1.5.0) via the Github link below.
- Source document
- stylemods/scss/utilities/lists.scss
- View on Github
- https://github.com/pmbrown/StyleMods/blob/main/scss/utilities/lists.scss
Shared documentation about how to customize the default property values for the styles using the Sass and CSS variables is provided on the customizing page.