Skip to content

Instantly share code, notes, and snippets.

@S3ak
Created January 12, 2015 09:22
Show Gist options
  • Save S3ak/fe2cea23116e09fc48ec to your computer and use it in GitHub Desktop.
Save S3ak/fe2cea23116e09fc48ec to your computer and use it in GitHub Desktop.
/// Mixin helping defining both `width` and `height` simultaneously.
///
/// @author Hugo Giraudel
///
/// @access public
///
/// @param {Length} $width - Element's `width`
/// @param {Length} $height ($width) - Element's `height`
///
/// @example scss - Usage
/// .foo {
/// @include size(10em);
/// }
///
/// .bar {
/// @include size(100%, 10em);
/// }
///
/// @example css - CSS output
/// .foo {
/// width: 10em;
/// height: 10em;
/// }
///
/// .bar {
/// width: 100%;
/// height: 10em;
/// }
@mixin size($width, $height: $width) {
width: $width;
height: $height;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment