Helpers
Utilities
Helper classes for spacing, display, visibility, borders, dimensions, text wrapping, and animations.
Display
Display Utilities
| Class | CSS |
|---|---|
display-flex | display: flex |
display-block | display: block |
display-inline-block | display: inline-block |
display-grid | display: grid |
display-none | display: none |
display-table | display: table |
display-table-cell | display: table-cell |
Flex
Flex Alignment
Use with display-flex to align children along both axes.
Align Items
items-center | align-items: center |
items-start | align-items: flex-start |
items-end | align-items: flex-end |
items-stretch | align-items: stretch |
items-baseline | align-items: baseline |
Justify Content
justify-center | justify-content: center |
justify-start | justify-content: flex-start |
justify-end | justify-content: flex-end |
justify-between | justify-content: space-between |
justify-around | justify-content: space-around |
Legacy Alignment Classes
These older alignment classes are also available. The shorter items-* and justify-* classes above are preferred.
fully-centered | Flex center on both axes |
horizontally-centered | justify-content: center |
vertically-centered-space-between | Vertical center, space-between |
align-center | align-items: center + text-align center |
align-middle | align-items: center |
align-baseline | align-items: baseline |
align-flex-start | align-items: flex-start |
align-flex-end | align-items: flex-end |
align-stretch | align-items: stretch |
justify-flex-start | justify-content: flex-start |
justify-flex-end | justify-content: flex-end |
justify-space-between | justify-content: space-between |
justify-space-around | justify-content: space-around |
<div class="display-flex items-center justify-between">
<span>Left</span>
<span>Right</span>
</div>
<div class="display-flex items-center gap-sm">
<img src="avatar.jpg" alt="">
<span>Username</span>
</div> Position
Position Utilities
| Class | CSS |
|---|---|
fixed | position: fixed |
absolute | position: absolute |
relative | position: relative |
static | position: static |
sticky | position: sticky |
Spacing
Margin & Padding
All-Sides Scale
| Size | Margin | Padding |
|---|---|---|
| 0.25rem | margin-xs | padding-xs |
| 0.5rem | margin-sm | padding-sm |
| 0.75rem (default) | margin | padding |
| 1.5rem | margin-lg | padding-lg |
| 2rem | margin-xl | padding-xl |
| Remove all | no-margin | no-padding |
| Remove top | no-top-margin | no-top-padding |
| Remove bottom | no-bottom-margin | no-bottom-padding |
| Remove all spacing | no-spacing | |
Directional Scale
Works for both margin and padding. Replace * below with either.
| Size | Top | Bottom | Left | Right |
|---|---|---|---|---|
| xs (0.25rem) | *-top-xs | *-bottom-xs | *-left-xs | *-right-xs |
| sm (0.5rem) | *-top-sm | *-bottom-sm | *-left-sm | *-right-sm |
| (default) (0.75rem) | *-top | *-bottom | *-left | *-right |
| lg (1.5rem) | *-top-lg | *-bottom-lg | *-left-lg | *-right-lg |
| xl (2rem) | *-top-xl | *-bottom-xl | *-left-xl | *-right-xl |
Visual Demo
.padding .padding-top .padding-bottom .margin Gap
Gap Utilities
Apply consistent spacing between flex or grid children without margin hacks.
| Class | Size |
|---|---|
gap-xs | 0.25rem |
gap-sm | 0.5rem |
gap | 0.75rem |
gap-lg | 1.5rem |
gap-xl | 2rem |
Visual Demo
display-flex + gap-lg
<div class="display-flex gap-lg">
<div>A</div>
<div>B</div>
<div>C</div>
</div> Borders
Border Utilities
Other: no-border, border-radius, circle
Dimensions
Width & Height
Percentage-based width classes: width-10, width-20, width-25, width-33, width-40, width-50, width-66, width-70, width-75, width-80, width-90, width-100.
Height utilities use the same increments: height-100, height-90, height-80, height-75, height-70, height-50, height-33, height-25, height-10.
Responsive width variants: tablet-width-*, phone-width-*, small-desktop-width-*, large-phone-width-*.
Visibility
Show & Hide
| Class | Effect |
|---|---|
hide | display: none |
sr-only | Visually hidden, accessible to screen readers |
skip-link | Hidden until focused — use as first focusable element in body |
hide-on-desktop | Hidden on desktop, visible on mobile |
hide-on-mobile | Hidden on mobile, visible on desktop |
Text Wrap
Text Wrap Utilities
Control how text breaks across lines — prevent orphaned words or balance heading line lengths.
| Class | CSS | Use Case |
|---|---|---|
no-orphan | text-wrap: pretty | Prevents orphaned words on paragraphs |
text-balance | text-wrap: balance | Balances line lengths for headings |
nowrap | white-space: nowrap | Prevents all wrapping |
Visual Demo
Without text-balance
This heading demonstrates what happens without balanced text wrapping enabled
With text-balance
This heading demonstrates what happens with balanced text wrapping enabled
<h2 class="text-balance">Balanced heading text</h2>
<p class="no-orphan">Paragraph without orphaned words.</p> Links
Link Reset
Suppress link color and underline on all anchor elements inside a container. Useful for card grids and clickable containers.
Without no-link-style
With no-link-style
<div class="no-link-style">
<a href="/page" class="border border-radius padding display-block">
<h3>Card Title</h3>
<p>Card text renders as plain text, not link-blue.</p>
</a>
</div> Color
Text Color
Semantic Text Colors
text-primary — Body text color
text-secondary — Secondary text
text-tertiary — Muted text (alias: text-muted)
text-inverse — Inverse color
text-on-color — White text for colored backgrounds
success — Green status text
error — Red status text
Named Colors
color-blue
color-red
color-green
color-yellow
color-black
color-white
Opacity Scales
Black at 10–90% opacity: color-gray-10, color-gray-20, color-gray-30, color-gray-40, color-gray-50, color-gray-60, color-gray-70, color-gray-80, color-gray-90.
White at 10–90% opacity: color-white-10, color-white-20, color-white-30, color-white-40, color-white-50, color-white-60, color-white-70, color-white-80, color-white-90.
Background
Background Utilities
bg-blue | Blue background, WCAG AA with white text |
bg-red | Red background, WCAG AA with white text |
bg-green | Green background, WCAG AA with white text |
bg-yellow | Yellow background, WCAG AA with dark text |
bg-surface | Surface background (alias: background-white) |
background-black | Black background |
bg-glass | Frosted glass with backdrop blur |
Elevation
Layers & Shadows
Layer classes (layer-0, layer-1, layer-2, layer-3) combine a
background color with a matching shadow for consistent elevation.
Shadow classes (shadow-1, shadow-2, shadow-3) apply box-shadow only.
Fonts
Font Family
sans — System sans-serif font stack
serif — Georgia serif font family
mono — Monospace font family
Legacy class: code applies inline code styling (prefer the native <code> element).
Cursors
Cursor Utilities
| Class | Cursor |
|---|---|
cursor-pointer | Pointer hand |
cursor-default | Default arrow |
cursor-text | Text I-beam |
cursor-move | Move crosshair |
cursor-not-allowed | Not allowed |
cursor-help | Help indicator |
cursor-progress | Loading spinner |
cursor-crosshair | Crosshair |
cursor-copy | Copy indicator |
cursor-alias | Alias/shortcut |
cursor-cell | Cell/plus |
cursor-context-menu | Context menu |
cursor-no-drop | No drop |
cursor-all-scroll | All-scroll |
cursor-none | Hidden cursor |
cursor-ew-resize | Horizontal resize |
cursor-ns-resize | Vertical resize |
cursor-nesw-resize | Diagonal resize |
Also: cursor-n-resize, cursor-e-resize, cursor-s-resize, cursor-w-resize, cursor-ne-resize, cursor-nw-resize, cursor-sw-resize, cursor-se-resize
Components
Component Utilities
Pre-built component classes for common UI patterns. These require JavaScript for interactivity but ply provides all the styling.
Accordion
accordion-title | Clickable header |
accordion-title-opened | Open state header |
accordion-panel | Content panel (hidden by default) |
accordion-toggle | Toggle indicator |
accordion-toggle-closed | Plus icon indicator |
accordion-toggle-opened | Minus icon indicator |
Dropdown
dropdown | Absolute-positioned panel |
caret | Down-pointing arrow indicator |
caret-up | Up-pointing arrow indicator |
Modal
For most use cases, prefer the native <dialog> element which ply auto-styles.
These classes are for custom modal implementations.
modal | Modal dialog box |
modal-box | Full-screen overlay container |
modal-blur | Blur background content |
modal-close | Close button (top-right) |
Tooltip
tooltip | Base tooltip popup |
tooltip-theme-blue | Blue tooltip |
tooltip-theme-red | Red tooltip |
tooltip-theme-green | Green tooltip |
tooltip-theme-yellow | Yellow tooltip |
tooltip-theme-white | White tooltip |
Loader & Embed
loader | Spinning loader animation |
flexible-embed | 16:9 responsive iframe/video container |
Animation
Animation Utilities
spinning
<div class="spinning">Loading spinner</div>
<div class="fade-in">Fades in on load</div> Miscellaneous
Other Utilities
| Class | Effect |
|---|---|
clearfix | Clear floats |
flat-list | Remove list bullets and margin |
circle | border-radius: 100% |
border-radius | Standard border radius (0.25rem) |
border-radius-lg | Large border radius (0.75rem) |
border-radius-xl | Extra large border radius (1.5rem) |
Flat List
- Item one — no bullet
- Item two — no margin
- Item three — clean list
Next
Next Steps
Learn about built-in accessibility features, or set up your AI agent to use ply.