Sha256: 9c3dc160886a7b4eecedb859e6fbcba18dd1704a2236e128de776718fb0b087d

Contents?: true

Size: 1.08 KB

Versions: 150

Compression:

Stored size: 1.08 KB

Contents

@charset "UTF-8";

/// Sets the `width` and `height` of the element.
///
/// @param {List} $size
///   A list of at most 2 size values.
///
///   If there is only a single value in `$size` it is used for both width and height. All units are supported.
///
/// @example scss - Usage
///   .first-element {
///     @include size(2em);
///   }
///
///   .second-element {
///     @include size(auto 10em);
///   }
///
/// @example css - CSS Output
///   .first-element {
///     width: 2em;
///     height: 2em;
///   }
///
///   .second-element {
///     width: auto;
///     height: 10em;
///   }
///
/// @todo Refactor in 5.0.0 to use a comma-separated argument

@mixin size($value) {
  $width: nth($value, 1);
  $height: $width;

  @if length($value) > 1 {
    $height: nth($value, 2);
  }

  @if is-size($height) {
    height: $height;
  } @else {
    @warn "`#{$height}` is not a valid length for the `$height` parameter in the `size` mixin.";
  }

  @if is-size($width) {
    width: $width;
  } @else {
    @warn "`#{$width}` is not a valid length for the `$width` parameter in the `size` mixin.";
  }
}

Version data entries

150 entries across 143 versions & 22 rubygems

Version Path
StyleSass-0.1.5 app/assets/stylesheets/addons/_size.scss
middleman-core-4.1.11 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
StyleSass-0.1.5.alpha app/assets/stylesheets/addons/_size.scss
codelation_assets-0.5.0 app/assets/stylesheets/bourbon/addons/_size.scss
middleman-core-4.1.10 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
garth-jekyll-theme-0.1.8 _sass/bourbon/addons/_size.scss
middleman-core-4.1.9 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.1.8 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
active_admin_pro-0.2.4 app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_size.scss
codelation_assets-0.4.0 app/assets/stylesheets/bourbon/addons/_size.scss
active_admin_pro-0.2.3 app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_size.scss
codelation_assets-0.3.9 app/assets/stylesheets/bourbon/addons/_size.scss
bourbon-4.2.7 app/assets/stylesheets/addons/_size.scss
active_admin_pro-0.2.2 app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_size.scss
middleman-core-4.1.7 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
codelation_assets-0.3.8 app/assets/stylesheets/bourbon/addons/_size.scss
codelation_assets-0.3.7 app/assets/stylesheets/bourbon/addons/_size.scss
middleman-core-4.1.6 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.1.5 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.1.3 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss