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
Name | Type | Default | Description |
---|---|---|---|
$width * | number | — | The width of the element. |
$height | number | $width | The 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;
}