Sha256: 68836a5dcfdd1e2aa039cfcfa42ac270d9d00c751a8f80531a88cf970511216d

Contents?: true

Size: 972 Bytes

Versions: 4

Compression:

Stored size: 972 Bytes

Contents

@charset "UTF-8";

/// Sets the `width` and `height` of the element in one statement.
///
/// @argument {number (with unit) | string} $width
///
/// @argument {number (with unit) | string} $height [$width]
///
/// @example scss
///   .first-element {
///     @include size(2em);
///   }
///
///   .second-element {
///     @include size(auto, 10em);
///   }
///
/// @example css
///   .first-element {
///     width: 2em;
///     height: 2em;
///   }
///
///   .second-element {
///     width: auto;
///     height: 10em;
///   }
///
/// @require {function} _is-size

@mixin size(
    $width,
    $height: $width
  ) {

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bourbon-5.0.0.beta.5 core/bourbon/library/_size.scss
bourbon-5.0.0.beta.4 core/bourbon/library/_size.scss
bourbon-5.0.0.beta.3 core/bourbon/library/_size.scss
bourbon-5.0.0.beta.2 core/bourbon/library/_size.scss