// ------------------------------------------------------------------- // // Kentucky Mixins // ------------------------------------------------------------------- // // Font Size / Line Height // ------------------------------------------------------------------- // @mixin font-size($font-size, $line-height: true){ font-size: $font-size; font-size: ($font-size / $base-font-size) * 1rem; @if $line-height == true{ line-height: ceil($font-size / $base-line-height) * ($base-line-height / $font-size); } } // ------------------------------------------------------------------- // // Style any number of headings at once // // .foo{ // @include headings(1,3){ // color: #B4DA55; // } // } // ------------------------------------------------------------------- // @mixin headings($from: 1, $to: 6){ %base-heading{ @content } @if $from >= 1 and $to <= 6{ @for $i from $from through $to{ h#{$i}{ @extend %base-heading; } } } } // ------------------------------------------------------------------- // // Text Truncation // // @include truncate(450px); // Only works for single-line truncation // ------------------------------------------------------------------- // @mixin truncate($truncation-boundary){ max-width: $truncation-boundary; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } // ------------------------------------------------------------------- // // Sprite Sheet // // @include sprite(0,0); // ------------------------------------------------------------------- // @mixin sprite($col, $row){ background: url($sprite-sheet-loc) no-repeat ($col * -$sprite-sheet-grid) ($row * -$sprite-sheet-grid); } // ------------------------------------------------------------------- // // Custom Borders / Widths // // @include border(2px 0 5px 3px, solid, #B4DA55); // ------------------------------------------------------------------- // @mixin border($border-widths, $border-style, $border-color){ border: $border-style $border-color; border-width: $border-widths; }