w-full, w-1/2, w-screen, w-fit — fractions and intrinsic sizing. This family contains 35 generated classes in Nakshora 3.0.

Classes#

ClassGenerated CSS
w-autowidth: auto;
w-1/2width: 50%;
w-1/3width: 33.333333%;
w-2/3width: 66.666667%;
w-1/4width: 25%;
w-2/4width: 50%;
w-3/4width: 75%;
w-1/5width: 20%;
w-2/5width: 40%;
w-3/5width: 60%;
w-4/5width: 80%;
w-1/6width: 16.666667%;
w-2/6width: 33.333333%;
w-3/6width: 50%;
w-4/6width: 66.666667%;
w-5/6width: 83.333333%;
w-1/12width: 8.333333%;
w-2/12width: 16.666667%;
w-3/12width: 25%;
w-4/12width: 33.333333%;
w-5/12width: 41.666667%;
w-6/12width: 50%;
w-7/12width: 58.333333%;
w-8/12width: 66.666667%;
w-9/12width: 75%;
w-10/12width: 83.333333%;
w-11/12width: 91.666667%;
w-fullwidth: 100%;
w-screenwidth: 100vw;
w-svwwidth: 100svw;
w-lvwwidth: 100lvw;
w-dvwwidth: 100dvw;
w-minwidth: min-content;
w-maxwidth: max-content;
w-fitwidth: fit-content;

Example#

example
html
<div class="w-full md:w-1/2 lg:w-1/3">Responsive thirds</div>

Responsive & variants#

Every class here accepts screen prefixes (sm:xl:) and state variants — md:hover:p-4 style stacks compile to a single media query. See responsive/index|Responsive design and variants/index|Variants.

Best practices#

  • Fractions go to twelfths: w-5/12 etc.
  • w-fit shrinks to content; w-min to the minimum

Common mistakes#

  • w-screen adds a horizontal scrollbar when body has padding

utilities/layout/aspect-ratio|Aspect ratio · utilities/spacing/spacing-scale|Spacing scale