Utility Classes¶
Small classes for visibility, fonts, and text color.
Decision¶
| When | Use |
|---|---|
| Showing and hiding a block | hidden or the [hidden] attribute. shared.setVisible toggles hidden for you. |
| Paths, ids, and addresses | stolon-mono. |
| The label of an icon only control | stolon-sr-only. |
A state shown with stolon-ok or stolon-bad |
The color paired with a word. Never the color as the only signal. |
Usage¶
<div class="stolon-hidden">Hidden</div>
<span class="stolon-mono">10.0.0.1</span>
<span class="stolon-ok">OK</span> <span class="stolon-bad">Failed</span>
<div class="stolon-url">URL: <a href="#">/pages/home</a></div>
<button type="button"><span class="material-icons" aria-hidden="true">delete</span><span class="stolon-sr-only">Remove the record</span></button>
Classes: stolon-hidden, stolon-mono, stolon-ok, stolon-bad, stolon-url, stolon-sr-only, stolon-icon-text, stolon-thumb, stolon-float.
States and Modifiers¶
stolon-hiddenisdisplay: none, forced.- The
[hidden]attribute hides too, even on a component with its owndisplayrule such as a flex row or a grid. stolon-urlis mono at 85 percent opacity, with links in the accent color.stolon-icon-textsets an icon beside text that may wrap, with the icon centered on the first line. It is medium by default and takessmallorlarge.stolon-thumbis an artwork frame that holds astolon-thumb-placeholdericon under astolon-thumb-image. The frame sets no size, so the component that uses it does. The image takeshiddenwhen it fails to load, andstolon-pendingwhile it loads.stolon-floatis the surface every floating box shares, such as a menu, a tooltip, a dropdown, or a toast. The popover helper adds it to the box it places.
Reference¶
Generated from the code by scripts/build-docs.mjs. Edit the code, not this section.
| Class | What it looks like |
|---|---|
stolon-hidden |
Hides an element outright |
stolon-mono |
Applies the mono font stack |
stolon-ok |
Success colored text |
stolon-bad |
Error colored text |
stolon-url |
Monospace, dimmed line for showing a URL or path with an accent link |
stolon-sr-only |
Visually hidden text that screen readers still read, such as a label for an icon only control |
stolon-thumb |
An artwork frame that holds a placeholder icon under its image, shared by media cards, media picker rows, checkbox list rows, and the image picker, which each set the size |
stolon-thumb-placeholder |
The icon that fills the frame while there is no image, or until it loads |
stolon-thumb-image |
The image that covers the frame, hidden when it fails to load |
stolon-icon-text |
An icon beside text that may wrap, with the icon centered on the first line of text, medium unless small or large |
stolon-float |
The surface every floating box shares, a menu, a filter panel, a help bubble, a tooltip, a dropdown, or a toast, over the page. anchorPopover adds it to the box it places |
Example¶
Example Code¶
<!-- title: Utility Classes -->
<div class="stolon-hidden">Hidden</div>
<div class="stolon-field-row" hidden>Also hidden</div>
<p>Host <span class="stolon-mono">10.0.0.1</span> returned <span class="stolon-ok">OK</span> and <span class="stolon-bad">Failed</span>.</p>
<p class="stolon-url">URL: <a href="#">/pages/home</a></p>
<button type="button" class="raised stolon-button stolon-secondary stolon-small">
<span class="material-icons" aria-hidden="true">delete</span><span class="stolon-sr-only">Remove the record</span>
</button>