Sizer
Type:
Mixin
@include
sizer();
* You can call mixins with or without
gls-
namespace (e.g. @include gls-sizer();
).Sizer Sass mixin helps you to size elements with one statement (or two). Size elements or create square or recangle shapes very easily.
Arguments
Name | Type | Description |
---|---|---|
$width | number (with unit), | Sets the width of the selected element(s). |
$height | number (with unit), | Sets the height of the selected element(s). The default value is set to |
Examples
Call the mixin to adjust the $width
and the $height
of an element.
.element{
@include sizer(200px);
}
//CSS Output
.element {
width: 200px;
height: 200px;
}
To assign different values to the width and height properties of an element, do the following:
.element{
@include sizer(500px, 100px);
}
//CSS Output
.element {
width: 500px;
height: 100px;
}
You can pass string values as well!
.element{
@include sizer(400px, auto);
}
//CSS Output
.element {
width: 400px;
height: auto;
}