Class Reference

Size

Class Reference

Size

Element sizes, widths, heights and viewport sizing.

How to use

Use width-full for a container that fills its parent. Set minimum or maximum dimensions when content should be allowed to grow. Viewport height classes are useful for full-height sections.

Responsive behavior

Percentage sizes depend on the parent. vh, svh and dvh describe different viewport heights; check the unit shown below before choosing a screen-height class.

Visual reference

Blue elements show the installed sizing classes. Dashed outlines mark the parent boundaries. Large examples can be scrolled so you can compare their width and height.

.size-5xswidth: var(--size-5xs) · height: var(--size-5xs)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-4xswidth: var(--size-4xs) · height: var(--size-4xs)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-3xswidth: var(--size-3xs) · height: var(--size-3xs)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-2xswidth: var(--size-2xs) · height: var(--size-2xs)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-xswidth: var(--size-xs) · height: var(--size-xs)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-smwidth: var(--size-sm) · height: var(--size-sm)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-mdwidth: var(--size-md) · height: var(--size-md)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-lgwidth: var(--size-lg) · height: var(--size-lg)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-xlwidth: var(--size-xl) · height: var(--size-xl)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-2xlwidth: var(--size-2xl) · height: var(--size-2xl)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-3xlwidth: var(--size-3xl) · height: var(--size-3xl)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-4xlwidth: var(--size-4xl) · height: var(--size-4xl)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-5xlwidth: var(--size-5xl) · height: var(--size-5xl)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-displaywidth: var(--size-display) · height: var(--size-display)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.size-dividerwidth: var(--size-divider) · height: var(--size-divider)
Actual width and height from the size token.

The square uses the installed size variable without scaling. Very small tokens appear as a dot.

.width-autowidth: auto
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-fitwidth: fit-content
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-fullwidth: 100%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-screenwidth: 100vw
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-halfwidth: 50%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-thirdwidth: 33.3333%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-two-thirdswidth: 66.6667%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-quarterwidth: 25%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.width-three-quarterswidth: 75%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.height-autoheight: auto
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.height-fitheight: fit-content
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.height-fullheight: 100%
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.height-screenheight: 100vh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.height-screen-dynamicheight: 100dvh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.height-screen-smallheight: 100svh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.height-halfheight: 50%
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.min-width-0min-width: 0
UnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItemUnbrokenContentCanShrinkInsideThisFlexItem
Sibling

The target flex item may shrink below its content width; the sibling keeps 35% of the parent.

.min-width-fullmin-width: 100%
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.min-width-screenmin-width: 100vw
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.min-height-0min-height: 0
Tall content inside a shrinking flex item
Sibling · 64px

The target may shrink below its content height to leave room for the fixed-height sibling. The parent clips excess content.

.min-height-fullmin-height: 100%
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.min-height-screenmin-height: 100vh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.min-height-screen-dynamicmin-height: 100dvh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.min-height-screen-smallmin-height: 100svh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.min-height-half-screenmin-height: 50vh
Content height

The dashed parent is 200px tall. Percentage heights resolve against that parent; viewport units use your browser height.

.max-width-nonemax-width: none
Content width

The dashed frame is the parent width. The sample starts at 150% width; this class sets its maximum.

.max-width-fullmax-width: 100%
Content width

The dashed frame is the parent width. The sample starts at 150% width; this class sets its maximum.

.max-width-screenmax-width: 100vw
Content width

The dashed frame is the parent width. The sample starts at 150% width; this class sets its maximum.

.max-width-1920max-width: var(--layout-width-1920)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-1600max-width: var(--layout-width-1600)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-1440max-width: var(--layout-width-1440)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-1280max-width: var(--layout-width-1280)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-960max-width: var(--layout-width-960)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-768max-width: var(--layout-width-768)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-height-nonemax-height: none
Content height

The dashed parent is 200px tall. The sample starts at 320px height; this class sets its maximum.

.max-height-fullmax-height: 100%
Content height

The dashed parent is 200px tall. The sample starts at 320px height; this class sets its maximum.

.max-height-screenmax-height: 100vh
Content height

The dashed parent is 200px tall. The sample starts 80px taller than the browser viewport; this class sets its maximum.

.max-height-screen-dynamicmax-height: 100dvh
Content height

The dashed parent is 200px tall. The sample starts 80px taller than the browser viewport; this class sets its maximum.

.max-height-screen-smallmax-height: 100svh
Content height

The dashed parent is 200px tall. The sample starts 80px taller than the browser viewport; this class sets its maximum.

.overflow-visibleoverflow: visible
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-hiddenoverflow: hidden
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-clipoverflow: clip
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-autooverflow: auto
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-scrolloverflow: scroll
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-x-hiddenoverflow-x: hidden
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-x-autooverflow-x: auto
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-y-hiddenoverflow-y: hidden
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.overflow-y-autooverflow-y: auto
Oversized content →

Content is 160px wider and 100px taller than its parent. Scroll where the class allows it; visible overflow extends beyond the dashed boundary.

.aspect-autoaspect-ratio: auto
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-squareaspect-ratio: 1 / 1
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-videoaspect-ratio: 16 / 9
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-landscapeaspect-ratio: 4 / 3
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-portraitaspect-ratio: 3 / 4
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-photoaspect-ratio: 3 / 2
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-photo-portraitaspect-ratio: 2 / 3
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.aspect-wideaspect-ratio: 21 / 9
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.object-coverobject-fit: cover
Image placeholderImage placeholder

The same 4:3 image sits in a wide, 200px-high frame. Compare cropping, empty space, and stretching.

.object-containobject-fit: contain
Image placeholderImage placeholder

The same 4:3 image sits in a wide, 200px-high frame. Compare cropping, empty space, and stretching.

.object-fillobject-fit: fill
Image placeholderImage placeholder

The same 4:3 image sits in a wide, 200px-high frame. Compare cropping, empty space, and stretching.

.object-noneobject-fit: none
Image placeholderImage placeholder

The same 4:3 image sits in a wide, 200px-high frame. Compare cropping, empty space, and stretching.

.object-scale-downobject-fit: scale-down
Image placeholderImage placeholder

The same 4:3 image sits in a wide, 200px-high frame. Compare cropping, empty space, and stretching.

.aspect-4x5aspect-ratio: 4 / 5
Aspect ratio

A consistent starting width makes the ratios comparable. Auto uses the sample’s 120px content height.

.max-width-320max-width: var(--layout-width-320)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-480max-width: var(--layout-width-480)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

.max-width-640max-width: var(--layout-width-640)
Content width

The dashed frame is the parent width. The installed class controls the blue element’s width.

NextPositionExplore position classes and how to use them.