Sizing

Width

Utilities for sets the width of an element.


Variant

Active Checked Child-Selection Dark Mode Disabled Expand First-Last-Selection First-Letter Focus Focus-Visible Focus-Within Fullscreen Group-Focus Group-Hover Hover Landscape Light Mode Portrait Reduce-Motion Responsive Selection-Hover Visited

API

classcss
width-autowidth: auto
width-fullwidth: 100%
width-screenwidth: 100vw
classcss
width-pxwidth: 1px
width-0width: 0
width-1width: 0.25rem
width-2width: 0.5rem
width-3width: 0.75rem
width-4width: 1rem
width-5width: 1.25rem
width-6width: 1.5rem
width-8width: 2rem
width-10width: 2.5rem
width-12width: 3rem
width-16width: 4rem
width-20width: 5rem
width-24width: 6rem
width-32width: 8rem
width-40width: 10rem
width-48width: 12rem
width-56width: 14rem
width-64width: 16rem
width-72width: 18rem
width-80width: 20rem
width-88width: 22rem
width-96width: 24rem
width-104width: 26rem
width-112width: 28rem
classcss
width-1/2width: 50%
width-1/3width: 33.333333%
width-2/3width: 66.666667%
width-1/4width: 25%
width-2/4width: 50%
width-3/4width: 75%
width-1/5width: 20%
width-2/5width: 40%
width-3/5width: 60%
width-4/5width: 80%
width-1/6width: 16.666667%
width-2/6width: 33.333333%
width-3/6width: 50%
width-4/6width: 66.666667%
width-5/6width: 83.333333%
width-1/12width: 8.333333%
width-2/12width: 16.666667%
width-3/12width: 25%
width-4/12width: 33.333333%
width-5/12width: 41.666667%
width-6/12width: 50%
width-7/12width: 58.333333%
width-8/12width: 66.666667%
width-9/12width: 75%
width-10/12width: 83.333333%
width-11/12width: 91.666667%

Usage

Set basic width to an element.

<div class="width-4">
...
</div>
HTML
.dummy {
@extend
.width-4;
}
SCSS

Set full width to an element.

<div class="width-full">
...
</div>
HTML
.dummy {
@extend
.width-full;
}
SCSS

Set full width in viewport screen to an element.

<div class="width-screen">
...
</div>
HTML
.dummy {
@extend
.width-screen;
}
SCSS

Set 2-column width 1/2 to an element companion with flex utility (See Flex).

<div class="flex (expand)width-1/2">
<div> ... </div>
<div> ... </div>
</div>
HTML
.dummy-parrent {
@extend
.flex,
.(expand)width-1/2;
}
SCSS

Set 3-column width 1/3 to an element.

<div class="flex (expand)width-1/3">
<div> ... </div>
<div> ... </div>
<div> ... </div>
</div>
HTML
.dummy {
@extend
.flex,
.(expand)width-1/3;
}
SCSS

...mixed 3-column widths.

<div class="flex">
<div class="width-2/3">
...
</div>
<div class="width-1/3">
...
</div>
</div>
HTML
.dummy-parent {
@extend
.flex;
}
.dummy-child {
@extend
.width-2/3;
}
SCSS

Set 4-column width 1/4 to an element.

<div class="flex (expand)width-1/4">
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
</div>
HTML
.dummy {
@extend
.flex,
.(expand)width-1/4;
}
SCSS

...mixed 4-column widths.

<div class="flex">
<div class="width-2/4"> ... </div>
<div class="width-3/4"> ... </div>
</div>
HTML
.dummy-parent {
@extend
.flex;
}
.dummy-child {
@extend
.width-2/4;
}
SCSS

Set 5-column width 1/5 to an element.

<div class="flex (expand)width-1/5">
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
</div>
HTML
.dummy {
@extend
.flex,
.(expand)width-1/5;
}
SCSS

...mixed 5-column widths.

<div class="flex">
<div class="width-3/5"> ... </div>
<div class="width-2/5"> ... </div>
</div>
HTML
.dummy-parent {
@extend
.flex;
}
.dummy-child {
@extend
.width-3/5;
}
SCSS

Set 6-column width 1/6 to an element.

<div class="flex (expand)width-1/6">
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
</div>
HTML
.dummy {
@extend
.flex,
.(expand)width-1/6;
}
SCSS

...mixed 6-column widths.

<div class="flex">
<div class="width-4/6"> ... </div>
<div class="width-2/6"> ... </div>
</div>
HTML
.dummy-parent {
@extend
.flex;
}
.dummy-child {
@extend
.width-4/6;
}
SCSS

Set 12-column width 1/12 to an element.

<div class="flex (expand)width-1/12">
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
<div> ... </div>
</div>
HTML
.dummy {
@extend
.flex,
.(expand)width-1/12;
}
SCSS

...mixed 12-column widths.

<div class="flex">
<div class="width-4/12"> ... </div>
<div class="width-6/12"> ... </div>
<div class="width-2/12"> ... </div>
</div>
HTML
.dummy {
@extend
.flex;
}
.dummy {
@extend
.width-4/12;
}
SCSS

Use (expand) variant to apply width to all child elements.

<!-- Parent -->
<div class="(expand)width-24">
<!-- Child -->
<div>...</div>
<div>...</div>
<div>...</div>
</div>
HTML
.dummy {
@extend
.(expand)width-24;
}
SCSS