Utility Classes

While Oat is a classless framework at its core, it provides a comprehensive set of utility classes for layout, spacing, typography, and responsive design. No Angular wrappers needed — just add the class.

Flexbox

Stack layouts

hstack (horizontal)

A
B
C
html
<div class="hstack gap-2">
  <div>A</div>
  <div>B</div>
  <div>C</div>
</div>

vstack (vertical)

A
B
C
html
<div class="vstack gap-2">
  <div>A</div>
  <div>B</div>
  <div>C</div>
</div>

Flex utility classes

ClassCSS
.flexdisplay: flex
.flex-colflex-direction: column
.flex-rowflex-direction: row
.flex-wrapflex-wrap: wrap
.flex-1flex: 1
.hstackflex + center + wrap + gap
.vstackflex-column + gap

Alignment

Live: justify & align

justify-center + items-center

Centered

justify-between + items-center

Left
Right

justify-end

End
html
<!-- Center both axes -->
<div class="flex justify-center items-center" style="min-height: 80px;">
  <div>Centered</div>
</div>

<!-- Space between -->
<div class="flex justify-between items-center">
  <div>Left</div>
  <div>Right</div>
</div>

<!-- Align end -->
<div class="flex justify-end">
  <div>End</div>
</div>
ClassCSS
.items-centeralign-items: center
.items-startalign-items: flex-start
.items-endalign-items: flex-end
.justify-centerjustify-content: center
.justify-betweenjustify-content: space-between
.justify-endjustify-content: flex-end
.justify-startjustify-content: flex-start

Responsive flex direction

Items stack vertically on mobile and switch to horizontal on medium screens.

First
Second
Third
html
<!-- Vertical on mobile, horizontal on md+ -->
<div class="flex flex-col md:flex-row gap-2">
  <div class="flex-1">First</div>
  <div class="flex-1">Second</div>
  <div class="flex-1">Third</div>
</div>
ClassBreakpoint
.sm:flex-row / .sm:flex-col640px+
.md:flex-row / .md:flex-col768px+
.lg:flex-row / .lg:flex-col1024px+

Gap

Live: gap sizes

gap-1

A
B
C

gap-2

A
B
C

gap-4

A
B
C

gap-6

A
B
C
html
<div class="hstack gap-1">...</div>
<div class="hstack gap-2">...</div>
<div class="hstack gap-4">...</div>
<div class="hstack gap-6">...</div>
ClassValueResponsive
.gap-1var(--space-1) = 0.25rem
.gap-2var(--space-2) = 0.5rem.sm:gap-2 / .md:gap-2
.gap-3var(--space-3) = fluid
.gap-4var(--space-4) = fluid.sm:gap-4 / .md:gap-4
.gap-6var(--space-6) = fluid.sm:gap-6 / .md:gap-6
.gap-8var(--space-8) = fluid.sm:gap-8 / .md:gap-8

Spacing

Live: padding scale

p-2
p-4
p-6
p-8
html
<div class="p-2">Small padding</div>
<div class="p-4">Medium padding</div>
<div class="p-6">Large padding</div>
<div class="p-8">XL padding</div>

Live: responsive padding

This box starts with small padding and grows at each breakpoint.

p-2 sm:p-4 md:p-6

Resize to see padding grow

html
<!-- Grows at each breakpoint -->
<div class="p-2 sm:p-4 md:p-6">
  Responsive padding
</div>

Margin

ClassCSS
.mt-0margin-block-start: 0
.mt-2margin-block-start: var(--space-2)
.mt-4margin-block-start: var(--space-4)
.mt-6margin-block-start: var(--space-6)
.mt-8margin-block-start: var(--space-8)
.mb-0margin-block-end: 0
.mb-2margin-block-end: var(--space-2)
.mb-4margin-block-end: var(--space-4)
.mb-6margin-block-end: var(--space-6)
.mb-8margin-block-end: var(--space-8)

Padding

ClassCSSResponsive
.p-0padding: 0
.p-2padding: var(--space-2)
.p-4padding: var(--space-4).sm:p-4 / .md:p-4
.p-6padding: var(--space-6).sm:p-6 / .md:p-6
.p-8padding: var(--space-8).sm:p-8 / .md:p-8
.px-2padding-inline: var(--space-2)
.px-4padding-inline: var(--space-4).sm:px-4 / .md:px-4
.py-2padding-block: var(--space-2)
.py-4padding-block: var(--space-4)

Width

Live: max-width classes

max-w-sm (384px)
max-w-md (448px)
max-w-lg (512px)
max-w-xl (576px)
w-100 (100%)
html
<div class="max-w-sm">max-w-sm (384px)</div>
<div class="max-w-md">max-w-md (448px)</div>
<div class="max-w-lg">max-w-lg (512px)</div>
<div class="max-w-xl">max-w-xl (576px)</div>
<div class="w-100">w-100 (100%)</div>
ClassCSS
.w-100width: 100%
.w-autowidth: auto
.max-w-smmax-width: 24rem (384px)
.max-w-mdmax-width: 28rem (448px)
.max-w-lgmax-width: 32rem (512px)
.max-w-xlmax-width: 36rem (576px)

Display

Live: responsive display

Resize to see elements appear/disappear at breakpoints.

Always visible
Hidden on mobile (sm:d-block)
Hidden below 768px (md:d-block)
Mobile only (sm:d-none)
html
<!-- Always visible -->
<div>Always visible</div>

<!-- Hidden on mobile, shown at 640px+ -->
<div class="d-none sm:d-block">Hidden on mobile</div>

<!-- Hidden below 768px -->
<div class="d-none md:d-block">Hidden below 768px</div>

<!-- Visible only on mobile -->
<div class="d-block sm:d-none">Mobile only</div>
ClassCSS
.d-nonedisplay: none
.d-blockdisplay: block
.d-flexdisplay: flex
.d-griddisplay: grid
.d-inlinedisplay: inline
.d-inline-blockdisplay: inline-block
.d-inline-flexdisplay: inline-flex

Responsive display

PrefixBreakpointAvailable classes
sm:640px+.sm:d-block / .sm:d-flex / .sm:d-grid / .sm:d-none
md:768px+.md:d-block / .md:d-flex / .md:d-grid / .md:d-none
lg:1024px+.lg:d-block / .lg:d-flex / .lg:d-grid / .lg:d-none
xl:1280px+.xl:d-block / .xl:d-flex / .xl:d-grid / .xl:d-none

Convenience shortcuts

hide-mobile (hidden < 640px)
show-mobile (hidden ≥ 640px)
html
<div class="hide-mobile">Hidden below 640px</div>
<div class="show-mobile">Hidden above 640px</div>
ClassBehavior
.hide-mobileHidden below 640px
.show-mobileHidden above 640px

Typography

Live: text sizes

text-1 — Display

text-2 — Heading XL

text-3 — Heading LG

text-4 — Heading MD

text-5 — Heading SM

text-6 — Body

text-7 — Small

text-8 — XS

html
<p class="text-1">text-1 — Display</p>
<p class="text-2">text-2 — Heading XL</p>
<p class="text-3">text-3 — Heading LG</p>
<p class="text-4">text-4 — Heading MD</p>
<p class="text-5">text-5 — Heading SM</p>
<p class="text-6">text-6 — Body</p>
<p class="text-7">text-7 — Small</p>
<p class="text-8">text-8 — XS</p>

Live: responsive text sizes

This heading scales from small on mobile to large on desktop.

Responsive heading

text-5 → sm:text-4 → md:text-3 → lg:text-1

html
<!-- Scales up at each breakpoint -->
<p class="text-5 sm:text-4 md:text-3 lg:text-1 font-bold">
  Responsive heading
</p>

Live: text colors

Default text color

text-light

text-lighter

text-muted

text-primary

text-success

text-danger

text-warning

html
<p>Default text color</p>
<p class="text-light">text-light</p>
<p class="text-lighter">text-lighter</p>
<p class="text-muted">text-muted</p>
<p class="text-primary">text-primary</p>
<p class="text-success">text-success</p>
<p class="text-danger">text-danger</p>
<p class="text-warning">text-warning</p>

Live: font weights

font-normal (400)

font-medium (500)

font-semibold (600)

font-bold (700)

html
<p class="font-normal">font-normal (400)</p>
<p class="font-medium">font-medium (500)</p>
<p class="font-semibold">font-semibold (600)</p>
<p class="font-bold">font-bold (700)</p>

Live: text alignment

text-left
text-center
text-right
html
<div class="text-left">text-left</div>
<div class="text-center">text-center</div>
<div class="text-right">text-right</div>

Live: responsive alignment

Centered on mobile, left-aligned on medium screens.

text-center md:text-left — resize to see
html
<!-- Center on mobile, left on md+ -->
<div class="text-center md:text-left">
  text-center md:text-left
</div>

Live: truncation & line clamp

truncate (single line)

This is a very long piece of text that will be truncated with an ellipsis because the container is too narrow to fit it all.

line-clamp-2

This is a longer paragraph of text that will be clamped to exactly two lines using the line-clamp utility class. Any content beyond the second line will be hidden with an ellipsis.

line-clamp-3

This is a longer paragraph of text that will be clamped to exactly three lines using the line-clamp utility class. Any content beyond the third line will be hidden with an ellipsis. This gives you more visible content while still preventing overflow.

html
<!-- Single-line ellipsis -->
<p class="truncate">Very long text that gets truncated...</p>

<!-- Clamp to 2 lines -->
<p class="line-clamp-2">Multi-line text that clamps at 2 lines...</p>

<!-- Clamp to 3 lines -->
<p class="line-clamp-3">Multi-line text that clamps at 3 lines...</p>

Full reference

CategoryClasses
Size.text-1.text-8, .text-small, .text-xs, .text-regular
Color.text-light, .text-lighter, .text-danger, .text-success, .text-warning, .text-primary, .text-muted
Weight.font-normal, .font-medium, .font-semibold, .font-bold
Family.font-sans, .font-mono
Alignment.text-left, .text-center, .text-right + responsive variants
Line-height.leading-none, .leading-tight, .leading-snug, .leading-normal, .leading-relaxed, .leading-loose
Spacing.tracking-tighter.tracking-widest
Transform.uppercase, .lowercase, .capitalize, .normal-case
Decoration.underline, .line-through, .no-underline, .overline
Wrapping.text-balance, .text-pretty, .text-nowrap
Overflow.truncate, .line-clamp-1.line-clamp-4, .line-clamp-none
White-space.whitespace-normal, .whitespace-nowrap, .whitespace-pre, .whitespace-pre-line, .whitespace-pre-wrap
Word break.break-normal, .break-words, .break-all
Responsive size.sm:text-*, .md:text-*, .lg:text-*

Overflow

Live: overflow behavior

overflow-hidden

This long content is clipped by overflow-hidden — you cannot scroll to see it.

overflow-auto

This long content can be scrolled using overflow-auto to reveal hidden text.
html
<!-- Content is clipped -->
<div class="overflow-hidden" style="height: 60px;">
  Long content...
</div>

<!-- Content is scrollable -->
<div class="overflow-auto" style="height: 60px;">
  Long content...
</div>
ClassCSS
.overflow-autooverflow: auto
.overflow-hiddenoverflow: hidden
.overflow-x-autooverflow-x: auto

Misc utilities

Live: sr-only & unstyled

sr-only (visually hidden, accessible)

Visible textThis is only for screen readers ← hidden span exists after this text

unstyled list

  • No bullet markers
  • Clean list items
  • Perfect for nav menus
html
<!-- Screen-reader only -->
<span class="sr-only">Hidden visually</span>

<!-- Remove list styling -->
<ul class="unstyled">
  <li>Clean item</li>
</ul>
ClassWhat it does
.truncateSingle-line ellipsis overflow
.sr-onlyScreen-reader only (visually hidden)
.unstyledRemove list markers and link underlines (use on ul, ol, or a)

Margin (expanded)

Full margin utilities including inline (mx), block (my), and individual directions (ml, mr). Uses CSS logical properties.

Live: mx-auto centering

mx-auto max-w-sm

Block element centered with auto inline margin

html
<!-- Center a block element with mx-auto -->
<div class="mx-auto max-w-sm p-4">
  Centered block with max-width
</div>

Full margin reference

ClassCSSResponsive
.m-0.m-8margin: var(--space-*)sm: / md: / lg:
.m-automargin: auto
.mx-0.mx-8margin-inline: var(--space-*)sm:mx-4 etc.
.mx-automargin-inline: autosm: / md: / lg:
.my-0.my-8margin-block: var(--space-*)sm: / md: / lg:
.my-automargin-block: auto
.mt-0.mt-12margin-block-start: var(--space-*)sm: / md: / lg:
.mt-automargin-block-start: auto
.mb-0.mb-12margin-block-end: var(--space-*)sm: / md: / lg:
.mb-automargin-block-end: auto
.ml-0.ml-8margin-inline-start: var(--space-*)sm:ml-auto
.ml-automargin-inline-start: autosm: / md: / lg:
.mr-0.mr-8margin-inline-end: var(--space-*)sm:mr-auto
.mr-automargin-inline-end: autosm: / md: / lg:

Padding (expanded)

Full directional padding — pt, pb, pl, pr plus expanded px/py scales including 6 and 8.

Live: directional padding

pt-6
pb-6
pl-8
pr-8
px-6 py-3
html
<!-- Directional padding -->
<div class="pt-6">padding-block-start</div>
<div class="pb-6">padding-block-end</div>
<div class="pl-8">padding-inline-start</div>
<div class="pr-8">padding-inline-end</div>
<div class="px-6 py-3">inline 6, block 3</div>

Full padding reference

ClassCSSResponsive
.p-0.p-12padding: var(--space-*)sm: / md: / lg:
.px-0.px-8padding-inline: var(--space-*)sm: / md: / lg:
.py-0.py-8padding-block: var(--space-*)sm: / md: / lg:
.pt-0.pt-8padding-block-start: var(--space-*)sm: / md: / lg:
.pb-0.pb-8padding-block-end: var(--space-*)sm: / md: / lg:
.pl-0.pl-8padding-inline-start: var(--space-*)
.pr-0.pr-8padding-inline-end: var(--space-*)

Center utilities

Quick centering shortcuts — no need to set flex + align + justify manually.

Live: center & place-center

.center (flex)

Centered!

.place-center (grid)

Grid centered!
html
<!-- Flex center -->
<div class="center" style="min-height: 100px;">
  <span>Centered!</span>
</div>

<!-- Grid place-center -->
<div class="place-center" style="min-height: 100px;">
  <span>Grid centered!</span>
</div>
ClassCSSResponsive
.centerdisplay: flex; align-items: center; justify-content: centersm: / md: / lg:
.place-centerdisplay: grid; place-items: center
.mx-automargin-inline: auto (horizontally center a block)sm: / md: / lg:

Space-x / Space-y

Add spacing between child elements using the lobotomized owl selector (> * + *). Works like Tailwind's space-x/y.

Live: child spacing

space-x-4 (horizontal)

A
B
C

space-y-3 (vertical)

First
Second
Third
html
<!-- Horizontal child spacing -->
<div class="flex space-x-4">
  <div>A</div>
  <div>B</div>
  <div>C</div>
</div>

<!-- Vertical child spacing -->
<div class="space-y-3">
  <div>First</div>
  <div>Second</div>
  <div>Third</div>
</div>
ClassCSSResponsive
.space-x-1.space-x-8> * + * margin-inline-startsm: / md: / lg: (2, 4)
.space-y-1.space-y-8> * + * margin-block-startsm: / md: / lg: (2, 4)

Gap axis (gap-x / gap-y)

Control column-gap and row-gap independently, in addition to the existing .gap-* shorthand.

ClassCSSResponsive
.gap-x-1.gap-x-8column-gap: var(--space-*)sm: / md: / lg: (2, 4)
.gap-y-1.gap-y-8row-gap: var(--space-*)sm: / md: / lg: (2, 4)

Grid

CSS Grid utilities for column layouts. Responsive — stack on mobile, expand on larger screens.

Live: responsive grid

1
2
3
4
html
<!-- Responsive grid: 1 col → 2 cols → 4 cols -->
<div class="d-grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

Live: col-span

col-span-2
1 col
1 col
col-span-2
html
<!-- Column spanning -->
<div class="d-grid grid-cols-3 gap-4">
  <div class="col-span-2">col-span-2</div>
  <div>1 col</div>
  <div>1 col</div>
  <div class="col-span-2">col-span-2</div>
</div>
ClassCSSResponsive
.grid-cols-1.grid-cols-12grid-template-columns: repeat(n, minmax(0, 1fr))sm: / md: / lg:
.col-span-1.col-span-6grid-column: span nsm: / md: / lg:
.col-span-fullgrid-column: 1 / -1sm: / md: / lg:
.place-items-centerplace-items: center
.place-content-centerplace-content: center

Width & Height (expanded)

Fractional widths, full-screen heights, and responsive variants.

Live: fractional widths

w-full (100%)
w-3/4 (75%)
w-2/3 (66.7%)
w-1/2 (50%)
w-1/3 (33.3%)
w-1/4 (25%)
html
<!-- Fractional widths -->
<div class="w-full">100%</div>
<div class="w-3/4">75%</div>
<div class="w-2/3">66.7%</div>
<div class="w-1/2">50%</div>
<div class="w-1/3">33.3%</div>
<div class="w-1/4">25%</div>

Width reference

ClassCSSResponsive
.w-fullwidth: 100%sm: / md: / lg:
.w-screenwidth: 100vw
.w-fitwidth: fit-content
.w-autowidth: autosm: / md: / lg:
.w-1/2width: 50%sm: / md: / lg:
.w-1/3, .w-2/3width: 33.3% / 66.7%sm: / md: / lg:
.w-1/4, .w-3/4width: 25% / 75%sm: / md: / lg:
.min-w-0, .min-w-fullmin-width: 0 / 100%
.max-w-2xl.max-w-7xl42rem … 80rem
.max-w-none, .max-w-full, .max-w-screennone / 100% / 100vw

Height reference

ClassCSSResponsive
.h-autoheight: autosm: / md: / lg:
.h-fullheight: 100%sm: / md: / lg:
.h-screenheight: 100vhsm: / md: / lg:
.h-fitheight: fit-content
.min-h-0, .min-h-full, .min-h-screenmin-height: 0 / 100% / 100vhsm: / md: / lg: (screen)
.max-h-full, .max-h-screenmax-height: 100% / 100vh

Position

ClassCSSResponsive
.relativeposition: relativesm: / md: / lg:
.absoluteposition: absolutesm: / md: / lg:
.fixedposition: fixed
.stickyposition: stickysm: / md: / lg:
.staticposition: staticsm: / md: / lg:
.inset-0inset: 0
.inset-x-0inset-inline: 0
.inset-y-0inset-block: 0
.top-0, .right-0, .bottom-0, .left-0top/right/bottom/left: 0

Border & Radius

Live: border utilities

.border .rounded
.border-t
.border-b
.rounded-lg
.rounded-full
html
<!-- Border with rounded corners -->
<div class="border rounded p-4">border + rounded</div>
<div class="border-t p-4">border-t (top only)</div>
<div class="border-b p-4">border-b (bottom only)</div>
<div class="border rounded-lg p-4">rounded-lg</div>
<div class="border rounded-full p-4 px-6">rounded-full</div>
ClassCSS
.borderborder: 1px solid var(--border)
.border-0border: 0
.border-t, .border-b, .border-l, .border-rSingle-side 1px solid border
.rounded-noneborder-radius: 0
.rounded-smborder-radius: var(--radius-small)
.rounded / .rounded-mdborder-radius: var(--radius-medium)
.rounded-lgborder-radius: var(--radius-large)
.rounded-fullborder-radius: 9999px

Background

Live: background colors

bg-background
bg-card
bg-muted
bg-primary
bg-secondary
bg-accent
bg-danger
bg-success
bg-warning
html
<!-- Background color utilities -->
<div class="bg-background border rounded p-3">bg-background</div>
<div class="bg-card border rounded p-3">bg-card</div>
<div class="bg-muted rounded p-3">bg-muted</div>
<div class="bg-primary rounded p-3">bg-primary</div>
<div class="bg-secondary rounded p-3">bg-secondary</div>
<div class="bg-accent rounded p-3">bg-accent</div>
<div class="bg-danger rounded p-3">bg-danger</div>
<div class="bg-success rounded p-3">bg-success</div>
<div class="bg-warning rounded p-3">bg-warning</div>

Shadow

Live: shadow scale

shadow-sm
shadow
shadow-md
shadow-lg
html
<!-- Shadow scale -->
<div class="shadow-sm rounded p-4 bg-card">shadow-sm</div>
<div class="shadow-md rounded p-4 bg-card">shadow-md</div>
<div class="shadow-lg rounded p-4 bg-card">shadow-lg</div>
ClassCSS
.shadow-nonebox-shadow: none
.shadow-smvar(--shadow-small)
.shadow / .shadow-mdvar(--shadow-medium)
.shadow-lgvar(--shadow-large)

Flex extras

ClassCSS
.flex-shrink-0flex-shrink: 0
.flex-growflex-grow: 1
.flex-grow-0flex-grow: 0
.flex-noneflex: none
.flex-nowrapflex-wrap: nowrap
.self-auto, .self-start, .self-center, .self-end, .self-stretchalign-self: *
.order-firstorder: -9999
.order-lastorder: 9999
.order-noneorder: 0

Visual & Interactive

Opacity, visibility, z-index, cursor, pointer-events, transitions, object-fit, and aspect-ratio utilities.

Live: opacity scale

100
75
50
25
0
html
<!-- Opacity scale -->
<div class="opacity-100 bg-primary p-3">100</div>
<div class="opacity-75 bg-primary p-3">75</div>
<div class="opacity-50 bg-primary p-3">50</div>
<div class="opacity-25 bg-primary p-3">25</div>
<div class="opacity-0 bg-primary p-3">0</div>

Reference

CategoryClasses
Opacity.opacity-0, .opacity-25, .opacity-50, .opacity-75, .opacity-100
Visibility.visible, .invisible
Z-index.z-0, .z-10, .z-20, .z-30, .z-40, .z-50
Cursor.cursor-default, .cursor-pointer, .cursor-not-allowed, .cursor-wait, .cursor-grab
Pointer events.pointer-events-none, .pointer-events-auto
User select.select-none, .select-all, .select-auto
Transitions.transition-none, .transition-all, .transition, .transition-colors, .transition-opacity, .transition-transform
Object fit.object-cover, .object-contain, .object-fill, .object-none
Aspect ratio.aspect-auto, .aspect-square, .aspect-video