Skip to content

Height

Below, utility classes to apply height property.

@for $value from 0 through 64

ClassProperties
.h-autoheight: auto;
.h-viewheight: 100vh;
.h-<value>height: #{$value * 0.25}rem;
.h-96height: 24rem; /* 384px */
.h-128height: 32rem; /* 512px */
.h-1/1height: 100%;
.h-1/2height: 50%;
.h-1/3height: 33.333%;
.h-2/3height: 66.667%;
.h-1/4height: 25%;
.h-2/4height: 50%;
.h-3/4height: 75%;
.h-1/5height: 20%;
.h-2/5height: 40%;
.h-3/5height: 60%;
.h-4/5height: 80%;
.h-1/6height: 16.667%;
.h-2/6height: 33.333%;
.h-3/6height: 50%;
.h-4/6height: 66.667%;
.h-5/6height: 83.333%;

Example(s)

html
<div class="w-12 h-64 ..."></div>
<div class="w-12 h-56 ..."></div>
<div class="w-12 h-48 ..."></div>
<div class="w-12 h-32 ..."></div>
<div class="w-12 h-24 ..."></div>
<div class="w-12 h-16 ..."></div>
<div class="w-12 h-8 ..."></div>
html
<div class="flex-row h-64">
  <div class="w-12 h-1/4 ..."></div>
  <div class="w-12 h-2/4 ..."></div>
  <div class="w-12 h-3/4 ..."></div>
  <div class="w-12 h-1/1 ..."></div>
</div>

Min Height

Below, utility classes to apply min-height property.

@for $value from 0 through 64

ClassProperties
.min-h-<value>min-height: #{$value * 0.25}rem;

Max Height

Below, utility classes to apply max-height property.

@for $value from 0 through 64

ClassProperties
.max-h-<value>max-height: #{$value * 0.25}rem;

Media Queries

height is supported by changing state on-the-fly! You can use it like this:

html
<div class="h-1/1 small:h-1/4 medium:h-1/2 large:h-3/4">...</div>

Released under the Beerware 🍺 License.