MelangeCSS Reference

Current Version: 1.0.0-RC5

Widths And Heights

Along with the spacings group, widths and heights allow control over sizes using the built-in spacing scale. The widths and heights here are identical to the value used in the spacings group, so your design should have visual harmony and consistency.

Properties

Box Sizing

Box sizing controls how the width and height are calculated. MelangeCSS sets the default to border-box (which is not the browser default) as this avoids some issues with predicting and controlling sizing

content-box
.content-box {
  box-sizing: content-box;
}
border-box
.border-box {
  box-sizing: border-box;
}
Height
h*
Height Height
h-1
.h-1 {
  height: calc(2 * var(--sp-1));
}
.h-1
h-2
.h-2 {
  height: calc(2 * var(--sp-2));
}
.h-2
h-3
.h-3 {
  height: calc(2 * var(--sp-3));
}
.h-3
h-4
.h-4 {
  height: calc(2 * var(--sp-4));
}
.h-4
h-5
.h-5 {
  height: calc(2 * var(--sp-5));
}
.h-5
h-6
.h-6 {
  height: calc(2 * var(--sp-6));
}
.h-6
h-7
.h-7 {
  height: calc(2 * var(--sp-7));
}
.h-7
h-8
.h-8 {
  height: calc(2 * var(--sp-8));
}
.h-8
Percentages
h-10
.h-10 {
  height: 10%;
}
.h-10
h-20
.h-20 {
  height: 20%;
}
.h-20
h-25
.h-25 {
  height: 25%;
}
.h-25
h-30
.h-30 {
  height: 30%;
}
.h-30
h-40
.h-40 {
  height: 40%;
}
.h-40
h-50
.h-50 {
  height: 50%;
}
.h-50
h-60
.h-60 {
  height: 60%;
}
.h-60
h-70
.h-70 {
  height: 70%;
}
.h-70
h-75
.h-75 {
  height: 75%;
}
.h-75
h-80
.h-80 {
  height: 80%;
}
.h-80
h-90
.h-90 {
  height: 90%;
}
.h-90
h-100
.h-100 {
  height: 100%;
}
.h-100
h-third
.h-third {
  height: calc(100% / 3);
}
.h-third
h-two-thirds
.h-two-thirds {
  height: calc(100% / 1.5);
}
.h-two-thirds
Percentages of View Height
h-10vh
.h-10vh {
  height: 10vh;
}
.h-10vh
h-20vh
.h-20vh {
  height: 20vh;
}
.h-20vh
h-30vh
.h-30vh {
  height: 30vh;
}
.h-30vh
h-40vh
.h-40vh {
  height: 40vh;
}
.h-40vh
h-50vh
.h-50vh {
  height: 50vh;
}
.h-50vh
h-60vh
.h-60vh {
  height: 60vh;
}
.h-60vh
h-70vh
.h-70vh {
  height: 70vh;
}
.h-70vh
h-80vh
.h-80vh {
  height: 80vh;
}
.h-80vh
h-90vh
.h-90vh {
  height: 90vh;
}
.h-90vh
h-100vh
.h-100vh {
  height: 100vh;
}
.h-100vh
h-auto
.h-auto {
  height: auto;
}
.h-auto
max-height*
Height Max Height
max-height-1
.max-height-1 {
  max-height: calc(2 * var(--sp-1));
}
max-height-2
.max-height-2 {
  max-height: calc(2 * var(--sp-2));
}
max-height-3
.max-height-3 {
  max-height: calc(2 * var(--sp-3));
}
max-height-4
.max-height-4 {
  max-height: calc(2 * var(--sp-4));
}
max-height-5
.max-height-5 {
  max-height: calc(2 * var(--sp-5));
}
max-height-6
.max-height-6 {
  max-height: calc(2 * var(--sp-6));
}
max-height-7
.max-height-7 {
  max-height: calc(2 * var(--sp-7));
}
max-height-8
.max-height-8 {
  max-height: calc(2 * var(--sp-8));
}
Percentages
max-height-10
.max-height-10 {
  max-height: 10%;
}
max-height-20
.max-height-20 {
  max-height: 20%;
}
max-height-25
.max-height-25 {
  max-height: 25%;
}
max-height-30
.max-height-30 {
  max-height: 30%;
}
max-height-40
.max-height-40 {
  max-height: 40%;
}
max-height-50
.max-height-50 {
  max-height: 50%;
}
max-height-60
.max-height-60 {
  max-height: 60%;
}
max-height-70
.max-height-70 {
  max-height: 70%;
}
max-height-75
.max-height-75 {
  max-height: 75%;
}
max-height-80
.max-height-80 {
  max-height: 80%;
}
max-height-90
.max-height-90 {
  max-height: 90%;
}
max-height-100
.max-height-100 {
  max-height: 100%;
}
max-height-third
.max-height-third {
  max-height: calc(100% / 3);
}
max-height-two-thirds
.max-height-two-thirds {
  max-height: calc(100% / 1.5);
}
Percentages of View Height
max-height-10vh
.max-height-10vh {
  max-height: 10vh;
}
max-height-20vh
.max-height-20vh {
  max-height: 20vh;
}
max-height-30vh
.max-height-30vh {
  max-height: 30vh;
}
max-height-40vh
.max-height-40vh {
  max-height: 40vh;
}
max-height-50vh
.max-height-50vh {
  max-height: 50vh;
}
max-height-60vh
.max-height-60vh {
  max-height: 60vh;
}
max-height-70vh
.max-height-70vh {
  max-height: 70vh;
}
max-height-80vh
.max-height-80vh {
  max-height: 80vh;
}
max-height-90vh
.max-height-90vh {
  max-height: 90vh;
}
max-height-100vh
.max-height-100vh {
  max-height: 100vh;
}
max-height-auto
.max-height-auto {
  max-height: auto;
}
Width
w*
Width Width
w-1
.w-1 {
  width: calc(2 * var(--sp-1));
}
.w-1
w-2
.w-2 {
  width: calc(2 * var(--sp-2));
}
.w-2
w-3
.w-3 {
  width: calc(2 * var(--sp-3));
}
.w-3
w-4
.w-4 {
  width: calc(2 * var(--sp-4));
}
.w-4
w-5
.w-5 {
  width: calc(2 * var(--sp-5));
}
.w-5
w-6
.w-6 {
  width: calc(2 * var(--sp-6));
}
.w-6
w-7
.w-7 {
  width: calc(2 * var(--sp-7));
}
.w-7
w-8
.w-8 {
  width: calc(2 * var(--sp-8));
}
.w-8
Percentages
w-10
.w-10 {
  width: 10%;
}
.w-10
w-20
.w-20 {
  width: 20%;
}
.w-20
w-25
.w-25 {
  width: 25%;
}
.w-25
w-30
.w-30 {
  width: 30%;
}
.w-30
w-40
.w-40 {
  width: 40%;
}
.w-40
w-50
.w-50 {
  width: 50%;
}
.w-50
w-60
.w-60 {
  width: 60%;
}
.w-60
w-70
.w-70 {
  width: 70%;
}
.w-70
w-75
.w-75 {
  width: 75%;
}
.w-75
w-80
.w-80 {
  width: 80%;
}
.w-80
w-90
.w-90 {
  width: 90%;
}
.w-90
w-100
.w-100 {
  width: 100%;
}
.w-100
w-third
.w-third {
  width: calc(100% / 3);
}
.w-third
w-two-thirds
.w-two-thirds {
  width: calc(100% / 1.5);
}
.w-two-thirds
Percentages of View Width
w-10vw
.w-10vw {
  width: 10vw;
}
.w-10vw
w-20vw
.w-20vw {
  width: 20vw;
}
.w-20vw
w-30vw
.w-30vw {
  width: 30vw;
}
.w-30vw
w-40vw
.w-40vw {
  width: 40vw;
}
.w-40vw
w-50vw
.w-50vw {
  width: 50vw;
}
.w-50vw
w-60vw
.w-60vw {
  width: 60vw;
}
.w-60vw
w-70vw
.w-70vw {
  width: 70vw;
}
.w-70vw
w-80vw
.w-80vw {
  width: 80vw;
}
.w-80vw
w-90vw
.w-90vw {
  width: 90vw;
}
.w-90vw
w-100vw
.w-100vw {
  width: 100vw;
}
.w-100vw
w-auto
.w-auto {
  width: auto;
}
.w-auto
mw*
Width Max Width
mw-1
.mw-1 {
  max-width: calc(2 * var(--sp-1));
}
mw-2
.mw-2 {
  max-width: calc(2 * var(--sp-2));
}
mw-3
.mw-3 {
  max-width: calc(2 * var(--sp-3));
}
mw-4
.mw-4 {
  max-width: calc(2 * var(--sp-4));
}
mw-5
.mw-5 {
  max-width: calc(2 * var(--sp-5));
}
mw-6
.mw-6 {
  max-width: calc(2 * var(--sp-6));
}
mw-7
.mw-7 {
  max-width: calc(2 * var(--sp-7));
}
mw-8
.mw-8 {
  max-width: calc(2 * var(--sp-8));
}
Percentages
mw-10
.mw-10 {
  max-width: 10%;
}
mw-20
.mw-20 {
  max-width: 20%;
}
mw-25
.mw-25 {
  max-width: 25%;
}
mw-30
.mw-30 {
  max-width: 30%;
}
mw-40
.mw-40 {
  max-width: 40%;
}
mw-50
.mw-50 {
  max-width: 50%;
}
mw-60
.mw-60 {
  max-width: 60%;
}
mw-70
.mw-70 {
  max-width: 70%;
}
mw-75
.mw-75 {
  max-width: 75%;
}
mw-80
.mw-80 {
  max-width: 80%;
}
mw-90
.mw-90 {
  max-width: 90%;
}
mw-100
.mw-100 {
  max-width: 100%;
}
mw-third
.mw-third {
  max-width: calc(100% / 3);
}
mw-two-thirds
.mw-two-thirds {
  max-width: calc(100% / 1.5);
}
Percentages of View Width
mw-10vw
.mw-10vw {
  max-width: 10vw;
}
mw-20vw
.mw-20vw {
  max-width: 20vw;
}
mw-30vw
.mw-30vw {
  max-width: 30vw;
}
mw-40vw
.mw-40vw {
  max-width: 40vw;
}
mw-50vw
.mw-50vw {
  max-width: 50vw;
}
mw-60vw
.mw-60vw {
  max-width: 60vw;
}
mw-70vw
.mw-70vw {
  max-width: 70vw;
}
mw-80vw
.mw-80vw {
  max-width: 80vw;
}
mw-90vw
.mw-90vw {
  max-width: 90vw;
}
mw-100vw
.mw-100vw {
  max-width: 100vw;
}
mw-auto
.mw-auto {
  max-width: auto;
}
minw*
Width Min Width
minw-1
.minw-1 {
  min-width: calc(2 * var(--sp-1));
}
minw-2
.minw-2 {
  min-width: calc(2 * var(--sp-2));
}
minw-3
.minw-3 {
  min-width: calc(2 * var(--sp-3));
}
minw-4
.minw-4 {
  min-width: calc(2 * var(--sp-4));
}
minw-5
.minw-5 {
  min-width: calc(2 * var(--sp-5));
}
minw-6
.minw-6 {
  min-width: calc(2 * var(--sp-6));
}
minw-7
.minw-7 {
  min-width: calc(2 * var(--sp-7));
}
minw-8
.minw-8 {
  min-width: calc(2 * var(--sp-8));
}
Percentages
minw-10
.minw-10 {
  min-width: 10%;
}
minw-20
.minw-20 {
  min-width: 20%;
}
minw-25
.minw-25 {
  min-width: 25%;
}
minw-30
.minw-30 {
  min-width: 30%;
}
minw-40
.minw-40 {
  min-width: 40%;
}
minw-50
.minw-50 {
  min-width: 50%;
}
minw-60
.minw-60 {
  min-width: 60%;
}
minw-70
.minw-70 {
  min-width: 70%;
}
minw-75
.minw-75 {
  min-width: 75%;
}
minw-80
.minw-80 {
  min-width: 80%;
}
minw-90
.minw-90 {
  min-width: 90%;
}
minw-100
.minw-100 {
  min-width: 100%;
}
minw-third
.minw-third {
  min-width: calc(100% / 3);
}
minw-two-thirds
.minw-two-thirds {
  min-width: calc(100% / 1.5);
}
Percentages of View Width
minw-10vw
.minw-10vw {
  min-width: 10vw;
}
minw-20vw
.minw-20vw {
  min-width: 20vw;
}
minw-30vw
.minw-30vw {
  min-width: 30vw;
}
minw-40vw
.minw-40vw {
  min-width: 40vw;
}
minw-50vw
.minw-50vw {
  min-width: 50vw;
}
minw-60vw
.minw-60vw {
  min-width: 60vw;
}
minw-70vw
.minw-70vw {
  min-width: 70vw;
}
minw-80vw
.minw-80vw {
  min-width: 80vw;
}
minw-90vw
.minw-90vw {
  min-width: 90vw;
}
minw-100vw
.minw-100vw {
  min-width: 100vw;
}
minw-auto
.minw-auto {
  min-width: auto;
}