A utility-first CSS framework for building user interfaces.
Utilities – also known as "trumps," "helper classes," or "alterations" – are high-specificity selectors for making very targeted alterations to existing elements or components.
Each utility is a small, atomic style declaration that, when chained together, should mitigate most situations in which custom CSS must be written. Just write these classes right in your mark-up and you're all set!
Most utilities come with responsive options, enabling alterations at targeted screen size ranges. For example, "small padding on smaller screens, larger padding on bigger screens."
While an atomic CSS approach comes with many advantages, we recognize it also offers a notable disadvantage: reducing the CSS cascade. This is especially true for repeated UI elements, which can end up creating redundant mark-up. For these instances, Dialtone offers components.
d-bt applies a border (b) to the top (t) side. 1px is the default width, and the color is inherited from the foreground color (currentColor).
<div class="d-bt"> <dt-text>Box</dt-text> </div>
d-btw4 applies a 4px (4) width (w) to the top (t).
<div class="d-bt d-btw4"> <dt-text>Box</dt-text> </div>
d-bc-critical applies a critical border (b) color (c).
<div class="d-bt d-btw4 d-bc-critical"> <dt-text>Box</dt-text> </div>
A basic example styling a container by combining Dialtone's CSS utilities. Follow each step with this Codepen template.
<div> <dt-text>Box</dt-text> </div>
Apply a Moderate Surface Color.
<div class="d-bgc-moderate"> <dt-text>Box</dt-text> </div>
Let's use d-fc-secondary from the font color utilities.
<div class="d-bgc-moderate d-fc-secondary"> <dt-text>Box</dt-text> </div>
Let's use d-p-100 padding for all four sides, from the list of padding utility classes.
<div class="d-bgc-moderate d-fc-secondary d-p-100"> <dt-text>Box</dt-text> </div>
Let's repeat them in a Stack component. Note that I've moved the surface and foreground colors to the parent container so they may inherit.
<div class="d-p-100"> <dt-text>Box 1</dt-text> </div> <div class="d-p-100"> <dt-text>Box the 2nd</dt-text> </div> <div class="d-p-100"> <dt-text>Box third</dt-text> </div> <div class="d-p-100"> <dt-text>Box IV</dt-text> </div>
Let's add the direction prop to make them flow horizontally.
<div class="d-p-100"> <dt-text>Box 1</dt-text> </div> <div class="d-p-100"> <dt-text>Box the 2nd</dt-text> </div> <div class="d-p-100"> <dt-text>Box third</dt-text> </div> <div class="d-p-100"> <dt-text>Box IV</dt-text> </div>
Add a border between each item with d-divide-x. Its default color is currentColor.
<div class="d-p-100"> <dt-text>Box 1</dt-text> </div> <div class="d-p-100"> <dt-text>Box the 2nd</dt-text> </div> <div class="d-p-100"> <dt-text>Box third</dt-text> </div> <div class="d-p-100"> <dt-text>Box IV</dt-text> </div>
Since the border color inherits the color of the parent's foreground (implicitly currentColor), let's soften it with a bold border color d-divide-bold.
<div class="d-p-100"> <dt-text>Box 1</dt-text> </div> <div class="d-p-100"> <dt-text>Box the 2nd</dt-text> </div> <div class="d-p-100"> <dt-text>Box third</dt-text> </div> <div class="d-p-100"> <dt-text>Box IV</dt-text> </div>
Add some icons.
<dt-stack direction="row" gap="100" class="d-p-100"> <dt-icon class="d-fc-muted" name="alert-triangle" size="200" /> <dt-text>Box 1</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-p-100"> <dt-icon class="d-fc-muted" name="info" size="200" /> <dt-text>Box the 2nd</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-p-100"> <dt-icon class="d-fc-muted" name="alert-circle" size="200" /> <dt-text>Box third</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-p-100"> <dt-icon class="d-fc-muted" name="check-circle" size="200" /> <dt-text>Box IV</dt-text> </dt-stack>
Apply a semantic surface color to convey some meaning to them, e.g. d-bgc-critical.
<dt-stack direction="row" gap="100" class="d-bgc-critical d-p-100"> <dt-icon name="alert-triangle" size="200" /> <dt-text>Critical</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-bgc-info d-p-100"> <dt-icon name="alert-circle" size="200" /> <dt-text>Info</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-bgc-positive d-p-100"> <dt-icon name="check-circle" size="200" /> <dt-text>Positive</dt-text> </dt-stack>
Use the DtText component for text styling. It provides a semantic, prop-driven API for typography.
<dt-stack direction="row" gap="100" class="d-bgc-critical d-p-100"> <dt-icon name="alert-triangle" size="200" /> <dt-text kind="label" :size="200">Critical</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-bgc-info d-p-100"> <dt-icon name="alert-circle" size="200" /> <dt-text kind="label" :size="200">Info</dt-text> </dt-stack> <dt-stack direction="row" gap="100" class="d-bgc-positive d-p-100"> <dt-icon name="check-circle" size="200" /> <dt-text kind="label" :size="200">Positive</dt-text> </dt-stack>
Refine the spacing by adjusting the Stack gap prop and padding utilities for horizontal and vertical padding.
<dt-stack direction="row" gap="50" class="d-bgc-critical d-py-50 d-px-100"> <dt-icon name="alert-triangle" size="200" /> <dt-text kind="label" :size="200">Critical</dt-text> </dt-stack> <dt-stack direction="row" gap="50" class="d-bgc-info d-py-50 d-px-100"> <dt-icon name="alert-circle" size="200" /> <dt-text kind="label" :size="200">Info</dt-text> </dt-stack> <dt-stack direction="row" gap="50" class="d-bgc-positive d-py-50 d-px-100"> <dt-icon name="check-circle" size="200" /> <dt-text kind="label" :size="200">Positive</dt-text> </dt-stack>
Add d-bar-300 to each item for subtle rounded corners.
<dt-stack direction="row" gap="50" class="d-bar-300 d-bgc-critical d-py-50 d-px-100"> <dt-icon class="d-fc-muted" name="alert-triangle" size="200" /> <dt-text kind="label" :size="200">Critical</dt-text> </dt-stack> <dt-stack direction="row" gap="50" class="d-bar-300 d-bgc-info d-py-50 d-px-100"> <dt-icon class="d-fc-muted" name="alert-circle" size="200" /> <dt-text kind="label" :size="200">Info</dt-text> </dt-stack> <dt-stack direction="row" gap="50" class="d-bar-300 d-bgc-positive d-py-50 d-px-100"> <dt-icon class="d-fc-muted" name="check-circle" size="200" /> <dt-text kind="label" :size="200">Positive</dt-text> </dt-stack>
View the final result in this Codepen template. Continue to explore using the variety of CSS utilities listed here.
CSS Utilities documentation last updated Friday, September 4, 2026
fix/popover-modal-zindex-scope