-
-
Save alecperkins/3892985 to your computer and use it in GitHub Desktop.
Kind of a hack
This file contains 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
@function colorchoice($choice) { | |
@if $choice == "0" { | |
@return rgb(202,0,32); | |
} | |
@if $choice == "1" { | |
@return rgb(244,165,130); | |
} | |
@if $choice == "2" { | |
@return rgb(247,247,247); | |
} | |
@if $choice == "3" { | |
@return rgb(146,197,222); | |
} | |
@if $choice == "4" { | |
@return rgb(5,113,176); | |
} | |
} | |
@mixin choropleth($bucket) { | |
.RdBu .q#{$bucket}-5 { | |
$base-fill: colorchoice($bucket); | |
fill: $base-fill; | |
@include transition; | |
@include transition-duration(0.25s); | |
&:hover { | |
fill: darken($base-fill, 10%); | |
} | |
} | |
} | |
@include choropleth("0"); | |
@include choropleth("1"); | |
@include choropleth("2"); | |
@include choropleth("3"); | |
@include choropleth("4"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment