Created
July 18, 2013 18:35
-
-
Save nc/6031767 to your computer and use it in GitHub Desktop.
Fixed gradient-stops function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generates a striped background | |
@function gradient-stops($grid-columns, $color: $visual-grid-color) { | |
$transparent: rgba(0,0,0,0); | |
$column-width: flex-grid(1, $grid-columns); | |
$gutter-width: flex-gutter($grid-columns); | |
$column-offset: $column-width; | |
$values: ($transparent 0, $color 0); | |
@for $i from 1 to $grid-columns*2 { | |
@if is-even($i) { | |
$values: append($values, $transparent $column-offset, comma); | |
$values: append($values, $color $column-offset, comma); | |
$column-offset: $column-offset + $column-width; | |
} | |
@else { | |
$values: append($values, $color $column-offset, comma); | |
$values: append($values, $transparent $column-offset, comma); | |
$column-offset: $column-offset + $gutter-width; | |
} | |
} | |
@return $values; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment