Skip to content

Instantly share code, notes, and snippets.

@farinspace
Created October 31, 2014 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farinspace/2bc77fdb2d5a7d656cf6 to your computer and use it in GitHub Desktop.
Save farinspace/2bc77fdb2d5a7d656cf6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.6)
// Compass (v1.0.1)
// ----
@mixin size($size) {
$height: nth($size, 1);
$width: $height;
@if length($size) > 1 {
$height: nth($size, 2);
}
@if $height == auto or (type-of($height) == number and not unitless($height)) {
height: $height;
}
@if $width == auto or (type-of($width) == number and not unitless($width)) {
width: $width;
}
}
$height:10;
.sample {
@include size(10px $height + px)
}
.sample {
width: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment