Width

Width utilities control how wide an element can be, how it responds to its container, and how it behaves across responsive breakpoints. FrontAlign includes fixed widths, intrinsic sizing utilities, max-width helpers, fractional widths, and responsive variants.

Quick reference

ClassesPurpose
w-auto, w-full, w-screen, w-min, w-max, w-fitControl native width behavior, full parent width, viewport width and intrinsic content sizing.
w-0, w-1w-96Set predictable fixed widths from the FrontAlign spacing scale.
min-w-0, min-w-fullSet minimum horizontal constraints to prevent elements from collapsing below their content.
max-w-full, max-w-xs, max-w-smmax-w-7xlLimit horizontal growth for containers, cards, modals and readable prose columns.
w-1fr12, w-1fr6, w-1fr5, w-1fr4, w-1fr3, w-1fr2, w-2fr3, w-3fr4, w-5fr6, w-11fr12Size an element as a percentage of its parent — based on a 12-column grid with a special 5-column variant.
sm:, md:, lg:, xl:, 2xl:Change width behavior from a breakpoint and above.
w-full
fills parent
w-auto
sized by content
max-w-sm
capped, won't grow past this
w-fit, content wider than container
overflows the frame

Usage

Use width utilities directly on any element.

<div class="w-auto">Auto</div>
<div class="w-full">Full</div>
<div class="w-1fr2">Half</div>
<div class="w-1fr3">One Third</div>
<div class="w-2fr3">Two Thirds</div>
<div class="w-64">Fixed 16rem</div>
<div class="w-96">Fixed 24rem</div>

Width utilities can be combined with layout utilities such as is-flex, is-grid, gap-*, and max-w-*.

Core Width

Core utilities cover common native CSS width values.

ClassPurpose
w-autoLet the browser determine the width.
w-fullFill the available container width.
w-minShrink to the minimum content width.
w-maxExpand to the maximum content width.
w-fitFit the content while respecting available space.
w-screenMatch the viewport width.
<div class="w-full">
  Full width
</div>

<button className="button is-primary w-fit">
  Fit content
</button>

Min and Max Width

Min and max width utilities are useful for flexible layouts, readable content, and overflow control.

ClassCSS output
min-w-fullmin-width: 100%
max-w-fullmax-width: 100%
min-w-0min-width: 0
<div class="is-flex">
  <div class="min-w-0">
    This content can shrink inside a flex layout.
  </div>
</div>

min-w-0 is especially useful when text, code, or long content overflows inside Flexbox or Grid children.

Max Width Scale

Max width utilities limit how wide content can grow.

They are useful for readable text blocks, forms, modals, cards, and layout containers.

ClassCSS output
max-w-xsmax-width: 20rem
max-w-smmax-width: 24rem
max-w-mdmax-width: 28rem
max-w-lgmax-width: 32rem
max-w-xlmax-width: 36rem
max-w-2xlmax-width: 42rem
max-w-3xlmax-width: 48rem
max-w-4xlmax-width: 56rem
max-w-5xlmax-width: 64rem
max-w-6xlmax-width: 72rem
max-w-7xlmax-width: 80rem
<section class="max-w-3xl">
  <h1>Readable content width</h1>
  <p>Limit long-form content for better reading comfort.</p>
</section>

Fixed Width Scale

Fixed width utilities are useful for icons, media blocks, sidebars, small panels, thumbnails, and controlled UI elements.

Class rangeUse case
w-0w-96Set a predictable fixed width from the spacing scale.
ClassWidthClassWidth
w-10.25remw-82rem
w-20.5remw-102.5rem
w-30.75remw-123rem
w-41remw-164rem
w-51.25remw-246rem
w-61.5remw-6416rem
w-7218remw-8020rem
w-9624rem
<div class="is-flex align-items-center gap-3">
  <div class="w-12">Icon</div>
  <div class="w-64">Panel</div>
</div>

Fractional Widths

Fractional width utilities map common layout fractions to percentages.

They are useful inside Flexbox layouts, inline grids, custom split sections, and layout compositions that do not need CSS Grid column tracks.

ClassWidthMeaning
w-1fr128.333333%1 of 12 columns
w-1fr616.666667%1/6
w-1fr520%1/5
w-1fr425%1/4
w-1fr333.333333%1/3
w-1fr250%1/2
w-2fr366.666667%2/3
w-3fr475%3/4
w-5fr683.333333%5/6
w-11fr1291.666667%11 of 12 columns
8%
w-1fr12
17%
w-1fr6
20%
w-1fr5
25%
w-1fr4
33%
w-1fr3
50%
w-1fr2
67%
w-2fr3
75%
w-3fr4
83%
w-5fr6
92%
w-11fr12
<div class="is-flex flex-wrap gap-3">
  <div class="w-1fr3">Sidebar</div>
  <div class="w-2fr3">Content</div>
</div>

Responsive Class Reference

Base classResponsive variants
w-fullsm:w-full, md:w-full, lg:w-full, xl:w-full, 2xl:w-full
w-autosm:w-auto, md:w-auto, lg:w-auto, xl:w-auto, 2xl:w-auto
w-1fr12sm:w-1fr12, md:w-1fr12, lg:w-1fr12, xl:w-1fr12, 2xl:w-1fr12
w-1fr6sm:w-1fr6, md:w-1fr6, lg:w-1fr6, xl:w-1fr6, 2xl:w-1fr6
w-1fr5sm:w-1fr5, md:w-1fr5, lg:w-1fr5, xl:w-1fr5, 2xl:w-1fr5
w-1fr4sm:w-1fr4, md:w-1fr4, lg:w-1fr4, xl:w-1fr4, 2xl:w-1fr4
w-1fr3sm:w-1fr3, md:w-1fr3, lg:w-1fr3, xl:w-1fr3, 2xl:w-1fr3
w-1fr2sm:w-1fr2, md:w-1fr2, lg:w-1fr2, xl:w-1fr2, 2xl:w-1fr2
w-2fr3sm:w-2fr3, md:w-2fr3, lg:w-2fr3, xl:w-2fr3, 2xl:w-2fr3
w-3fr4sm:w-3fr4, md:w-3fr4, lg:w-3fr4, xl:w-3fr4, 2xl:w-3fr4
w-5fr6sm:w-5fr6, md:w-5fr6, lg:w-5fr6, xl:w-5fr6, 2xl:w-5fr6
w-11fr12sm:w-11fr12, md:w-11fr12, lg:w-11fr12, xl:w-11fr12, 2xl:w-11fr12

Notes

  • Use w-full when an element should fill its parent.
  • Use max-w-* to limit readable content and large surfaces.
  • Use min-w-0 to fix overflow inside Flexbox and Grid children.
  • Use fractional width utilities for Flexbox-based split layouts.
  • Use Grid column utilities when you need a full two-dimensional column system.
  • Responsive width variants follow FrontAlign's mobile-first breakpoint system.

FrontAlign