Skip to main content
PaperStack
Buy Pro

Utilities

PaperStack ships a focused set of utility classes in @paperstack/utilities. These are not meant to be a full Tailwind-style utility library — they cover the most common one-off needs without duplicating what the component system already handles.

@use "@paperstack/utilities/src/index.scss";

Spacing

Margin and padding utilities follow the naming pattern ps-{property}-{side}-{step}.

<div class="ps-p-4">16px padding all sides</div>
<div class="ps-px-3">12px horizontal padding</div>
<div class="ps-py-5">20px vertical padding</div>
<div class="ps-mt-2">8px margin-top</div>
<div class="ps-mb-4">16px margin-bottom</div>
<div class="ps-gap-2">8px gap (flex/grid children)</div>

Steps align to the spacing scale: 1=4px, 2=8px, 3=12px, 4=16px, 5=20px, 6=24px, 8=32px, 10=40px, 12=48px.

Layout

ClassEquivalent CSS
ps-containerMax-width centered container with inline padding
ps-flexdisplay: flex
ps-griddisplay: grid
ps-stackFlex column (vertical stack)
ps-clusterFlex row, wrapping (horizontal cluster)
ps-centerFlex center both axes
ps-hiddendisplay: none
ps-sr-onlyVisually hidden, accessible to screen readers

Typography

ClassEffect
ps-heading-xlDisplay-size heading
ps-heading-lgLarge section heading
ps-heading-smSmall heading / subtitle
ps-bodyDefault body text size
ps-fine-printSmall / caption text
ps-text-secondarySecondary (muted) text color
ps-text-primaryAccent / primary text color
ps-font-monoMonospace font stack
ps-font-readingSerif reading font stack
ps-truncateSingle-line overflow ellipsis
ps-balancetext-wrap: balance

Responsive

Responsive utilities are prefixed with a breakpoint name to apply only above that breakpoint. The pattern is ps-{breakpoint}:{utility} in the class attribute.

<!-- Hide on mobile, show on md+ -->
<div class="ps-hidden ps-md:ps-block">...</div>

<!-- Different column counts by breakpoint -->
<div class="ps-grid ps-grid-cols-1 ps-md:ps-grid-cols-3">...</div>

Available breakpoint prefixes: sm, md, lg, xl, 2xl.

State Utilities

ClassUse case
ps-interactiveCursor pointer + hover/active transitions
ps-disabledReduced opacity + pointer-events none
ps-loadingSkeleton shimmer animation
ps-selectedSelected state highlight

Paper Helpers

Utility classes specific to the paper aesthetic:

ClassEffect
ps-depth-0ps-depth-maxExplicit depth/elevation levels (0–5)
ps-layer-edgeSubtle inner shadow to simulate a page edge
ps-stacking-contextCreates an isolated stacking context
ps-paper--clipClips children to paper boundary