Last active
August 29, 2015 13:56
-
-
Save sullenfish/9215944 to your computer and use it in GitHub Desktop.
Polyfill gray() from CSS Color Level 4 with Stylus
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
/* Based on "Polyfill gray() from CSS Color Level 4 with SASS" | |
* by Lea Verou | |
* with revisions by Chris Eppstein | |
* https://gist.github.com/LeaVerou/9199277 | |
*/ | |
gray(intensity, alpha = 1) | |
rgba(intensity, intensity, intensity, alpha) | |
/* Testing our new function */ | |
body { | |
background: gray(50%); | |
background: gray(255, .2); | |
} | |
/* Test should output something like: */ | |
body { | |
background: #7f7f7f; | |
background: rgba(255, 255, 255, 0.2); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment