Created
November 21, 2009 16:49
-
-
Save imathis/240199 to your computer and use it in GitHub Desktop.
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
=gradient(!type, !coords, !color_start, !color_end, !color_stop = false) | |
!gradient= "#{!coords}, from(#{!color_start}), to(#{!color_end})" | |
@if !color_stop | |
!gradient= !gradient + ", " + !color_stop | |
background: -webkit-gradient(#{!type}, #{!gradient}) | |
background: -moz-#{!type}-gradient(#{!gradient}) | |
//* | |
Creates a radial gradient | |
Usage example: | |
// This will yeild a radial gradient with an apparent specular highlihgt | |
+gradient("45 45, 10, 52 50, 30" from(Cyan), to(DodgerBlue), color-stop(90%, DeepSkyBlue)) | |
=radial-gradient(!coords, !color1, !color2, !color_stop = false) | |
+gradient("radial", !coords, !color1, !color2, !color_stop) | |
=linear-gradient(!start, !end, !color1, !color2, !color_stop = false) | |
!coords = !start + ", " + !end | |
+gradient("linear", !coords, !color1, !color2, !color_stop) | |
//* | |
Creates a vertical linear gradient. | |
Usage examples: | |
// yields a gradient starting at the top with #fff, ending in #aaa | |
+v-gradient(#fff, #aaa) | |
// same as above but with a #ccc at the halfway point | |
+v-gradient(#fff, #aaa, color-stop(50%, #ccc)) | |
// same as the first example but with #ccc at the 30% from the top, and #bbb at 70% from the top | |
+v-gradient(#fff, #aaa, color-stop(30%, #ccc, 70%, #bbb)) | |
=v-gradient(!color1, !color2, !color_stop = false) | |
=linear-gradient("left top", "left bottom", !color1, !color2, !color_stop) | |
//* yields a horizontal linear gradient spanning from left to right | |
=h-gradient(!color1, !color2, !color_stop = false) | |
=linear-gradient("left top", "right top", !color1, !color2, !color_stop) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment