box

Sets the element size. Shorthand for both width and height properties.

Width or height value can be omitted using null (preferable) or its alias n .

Arguments

NameTypeDefaultDescription
$width *numberThe width of the element.
$heightnumber$widthThe height of the element.

Example

@use 'more-sass' as more;

.element-one {
  @include more.box(100px);
}

.element-two {
  @include more.box(100px, 200px);
}

.element-three {
  @include more.box(100px, null);
}

.element-four {
  @include more.box(null, 200px);
}
.element-one {
  width: 100px;
  height: 100px;
}

.element-two {
  width: 100px;
  height: 200px;
}

.element-three {
  width: 100px;
}

.element-four {
  height: 200px;
}
Edit this page on GitHub Updated at Tue, Jun 24, 2025