Sha256: a7534d5046db3504f5143f4710075073a9cd8aeddded951db9170741aca221ef

Contents?: true

Size: 944 Bytes

Versions: 10

Compression:

Stored size: 944 Bytes

Contents

// ------------------------------------------------------------------- //
//  Border Mixin
//
//  For use in instances where multiple border-widths are required
// ------------------------------------------------------------------- //

@mixin border($border-width, $border-style: solid, $border-color: black) {
  // if too many widths, throw error
  @if (length($border-width) > 4) {
    @warn "Border-width accepts a maximum of 4 width parameters;  #{length($border-width)} found.";
  }

  // New border width list
  $new-width: ();

  // Populate it
  @for $i from 1 through length($border-width) {

    // If border is unitless, append unit
    @if unitless(nth($border-width, $i)) {
      $new-width: append($new-width, nth($border-width, $i) + px);
    }

    // Otherwise, keep as is
    @else {
      $new-width: append($new-width, nth($border-width, $i));
    }
  }

  border: $border-style $border-color;
  border-width: $new-width;
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kentucky-1.5.1 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.5.0 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.4.0 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.2.1 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.2.0 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.1.0 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.0.5 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.0.4 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.0.3 app/assets/stylesheets/kentucky/helpers/_border.scss
kentucky-1.0.0 app/assets/stylesheets/kentucky/helpers/_border.scss