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