Skip to content

Instantly share code, notes, and snippets.

@polarblau
Created January 1, 2013 12:05
Show Gist options
  • Save polarblau/4426977 to your computer and use it in GitHub Desktop.
Save polarblau/4426977 to your computer and use it in GitHub Desktop.
// ...
$color-variation: 10%
$color-set-1: $dark-violet $dark-green $orange
$color-set-2: $gray $bright-violet $bright-green
$color-set-3: $turquoise $yellow $red
$color-sets: $color-set-1 $color-set-2 $color-set-3
=color($property: color, $level: 1, $variation: 0)
@for $i from 1 through length($color-sets)
$set : nth($color-sets, $i)
$color: nth($set, $level)
@if $variation != 0
@if $variation > 0
$color: lighten($color, $color-variation * $variation)
@else
$color: darken($color, $color-variation * $variation)
// default
@if $i == 1
#{$property}: $color
@else
html.color-set-#{$i} &
#{$property}: $color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment