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
middleman-core-4.5.1 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.5.0 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.4.3 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.4.2 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.4.0 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.11 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.10 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.8 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.7 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.3.3/fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.6 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.5 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.4 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.3 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.2 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.1 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
middleman-core-4.3.0 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss
federalist-basic-report-theme-0.1.7 _sass/uswds/lib/addons/_size.scss
uswds-jekyll-4.2.0 _sass/uswds/lib/addons/_size.scss
middleman-core-4.3.0.rc.4 fixtures/minify-css-app/source/stylesheets/bourbon/addons/_size.scss