Utility classes
These utility classes are a toolkit for making simple design/layout adjustments to individual elements. For generic layout helpers (concerning multiple elements), see Cluster, Stack, Grid, and Sidebar.
Class name | What it does | Demo |
---|---|---|
|
Adds padding of |
Basic padding
|
|
Adds padding of |
Large padding
|
|
Applies left justified text (usually to override centre or right justified text that has been applied to a parent) |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae hic culpa, accusantium fuga, voluptate magnam excepturi. Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem temporibus facilis, libero ratione cum quod id excepturi, tenetur dolorem, saepe similique dignissimos magni. |
|
Applies center justified text |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae hic culpa, accusantium fuga, voluptate magnam excepturi. Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem temporibus facilis, libero ratione cum quod id excepturi, tenetur dolorem, saepe similique dignissimos magni. |
|
Applies right justified text |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae hic culpa, accusantium fuga, voluptate magnam excepturi. Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem temporibus facilis, libero ratione cum quod id excepturi, tenetur dolorem, saepe similique dignissimos magni. |
|
Adds a 2px solid border matching the element’s color
|
Bordered and padded
|
|
Hides an element visually but leaves it available to screen readers. May help to clarify things for screen reader users. |
I am in screen reader output |
|
Centers a block element, using |
(demo not possible in this context) |
|
Same as |
(demo not possible in this context) |
|
Match the size of arbitrary text to a heading level. Only use where a heading element is not appropriate. | A A A A A A |
Widths
Widths are set relative to font-size, using the ch
unit and max-width
to allow wrapping.
ds-width-full
This resets an element to use the full width of the container (width: auto
on a block-level element; display: block
is enforced).
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.
<p class="ds-width-full">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.</p>
ds-width-full-text
This uses the full measure of 70ch ($measure
). Where the container is narrower than 70ch, it will take up the full width.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.
<p class="ds-width-full-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.</p>
ds-width-reduced-text
A reduced value of 50ch ($measureReduced
).
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.
<p class="ds-width-reduced-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.</p>
ds-width-half-text
Half the $measure
value.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.
<p class="ds-width-half-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.</p>
ds-width-half-text
A third of the $measure
value.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.
<p class="ds-width-third-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, est ac sodales maximus, eros purus ultricies libero, non tempor ex augue eu diam. Proin a lectus risus. In pulvinar, tortor quis vulputate scelerisque, ligula est faucibus nisi, varius tincidunt purus nibh eget dui. In ut sollicitudin elit.</p>