Make a quick color gradient with scss.
Created
July 29, 2014 08:37
-
-
Save ezos86/64bb044c913403ae4726 to your computer and use it in GitHub Desktop.
A Pen by ezos86.
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
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> |
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
@import "compass/css3"; | |
$color1:#000; | |
@for $i from 1 through 20 { | |
div:nth-child(#{$i}) { | |
background:lighten($color1,5%*$i); | |
width:10%; | |
float:left; | |
height:100px; | |
@if ($i<11){ | |
color:#f1f1f1; | |
} | |
} | |
$color2: lighten($color1,5%*$i); | |
div:nth-child(#{$i}):after { | |
content:'#{$color2}'; | |
position:absolute; | |
padding-left:8px; | |
padding-top:30px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment