Sha256: 87e6c32ca845cab5bdcae0cd7ce9d4b1dd989a54fbd3bea1205358086c8a79a8

Contents?: true

Size: 825 Bytes

Versions: 3

Compression:

Stored size: 825 Bytes

Contents

// Sizing mixin
@mixin size($size){

  // If only one value is present
  @if length($size) == 1{

    @if $size == auto{
      width: auto;
      height: auto;
    }
    @else if unitless($size){
      width: $size + px;
      height: $size + px;
    }
    @else if not(unitless($size)){
      width: $size;
      height: $size;
    }
  }

  // If both values are present
  @if length($size) == 2{

    $width: nth($size, 1);
    $height: nth($size, 2);

    @if $width == auto{
      width: $width;
    }
    @else if unitless($width){
      width: $width + px;
    }
    @else if not(unitless($width)){
      width: $width;
    }

    @if $height == auto{
      height: $height;
    }
    @else if unitless($height){
      height: $height + px;
    }
    @else if not(unitless($height)){
      height: $height;
    }
  }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kentucky-2.0.0 app/assets/stylesheets/kentucky/addons/_size.scss
kentucky-1.5.1 app/assets/stylesheets/kentucky/helpers/_size.scss
kentucky-1.5.0 app/assets/stylesheets/kentucky/helpers/_size.scss