Skip to main content

Extra Utilities

Helpful utilities for cursors, dimensions, overflow, and positioning!

Cursor & User Events

Change the mouse cursor and control user interactions:

ClassDescription
e-pCursor Pointer (hand) - for clickable items
e-nsNo Select - prevents text selection
e-neNo Events - disables pointer events
<div class="e-p">Click me!</div>
When to use

Add e-p to any clickable element that isn't already a button or link. This helps users know they can interact with it!

Dimensions

Set width and height of elements:

Width (ew-*)

ClassDescription
ew-100pWidth 100% (full width of parent)
ew-100vWidth 100dvw (full viewport width)
ew-iWidth inherit (same as parent)

Height (eh-*)

ClassDescription
eh-100pHeight 100% (full height of parent)
eh-100vHeight 100dvh (full viewport height)
eh-iHeight inherit (same as parent)
<div class="ew-100p">I take up all the space!</div>
About dvh/dvw

These are "dynamic viewport" units that work better on mobile phones where the address bar can hide/show!

Overflow

Control what happens when content is bigger than its container:

ClassDescription
ox-hOverflow-X Hidden (horizontal)
ox-aOverflow-X Auto (horizontal scroll)
oy-hOverflow-Y Hidden (vertical)
oy-aOverflow-Y Auto (vertical scroll)

Overflow Hidden

Content outside the box is clipped:

<div class="ox-h oy-h" style="width: 200px; height: 100px;">
Very long content that doesn't fit...
</div>

Overflow Auto (Scrollable)

Shows scrollbars when content overflows:

<div class="oy-a" style="height: 100px;">
<p>Line 1</p>
<p>Line 2</p>
<p>Line 3</p>
<!-- More lines... -->
</div>

Position

Control how elements are positioned on the page:

ClassDescription
dp-rPosition Relative - normal flow, can offset
dp-aPosition Absolute - relative to parent
dp-fPosition Fixed - relative to viewport
dp-sPosition Sticky - sticks when scrolling

Relative + Absolute

Common pattern for overlays:

<div class="dp-r">
<img src="photo.jpg" />
<span class="dp-a" style="top: 0; right: 0;"> Badge </span>
</div>
How it works

Set the parent to dp-r, then the child with dp-a will position itself relative to that parent!

Flex Alignment

Align items within a flex container:

Justify Content (X-axis / horizontal)

ClassDescription
dx-fsJustify Content Flex-Start (left)
dx-feJustify Content Flex-End (right)
dx-ceJustify Content Center
dx-sbJustify Content Space-Between
dx-saJustify Content Space-Around
dx-seJustify Content Space-Evenly

Align Items (Y-axis / vertical)

ClassDescription
dy-fsAlign Items Flex-Start (top)
dy-feAlign Items Flex-End (bottom)
dy-ceAlign Items Center
dy-stAlign Items Stretch (default)

Centering with Flex

Center items both ways with dx-ce and dy-ce:

<div class="d-flex dx-ce dy-ce" style="height: 100px;">
<div>Perfectly centered!</div>
</div>

Space Between

Push items to opposite ends:

<div class="d-flex dx-sb">
<div>Left</div>
<div>Right</div>
</div>

Quick Reference

CategoryClasses
Eventse-p, e-ns, e-ne
Dimensionsew-100p, eh-100v
Overflowox-h, oy-a
Positiondp-r, dp-a, dp-f, dp-s