Last active
February 3, 2016 14:07
-
-
Save brianmcallister/3659524 to your computer and use it in GitHub Desktop.
Sass mixin for setting an element's size.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Size mixin. | |
// https://gist.github.com/brianmcallister/3659524 | |
// | |
// $width - Element width, with units. | |
// $height - Optional height of the element. Expects units, ex: 5px. | |
// Defaults to null. | |
@mixin size($width, $height: null) { | |
width: $width; | |
@if $height { | |
height: $height; | |
} @else { | |
height: $width; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment