Skip to content

Instantly share code, notes, and snippets.

@sullenfish
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sullenfish/9215944 to your computer and use it in GitHub Desktop.
Save sullenfish/9215944 to your computer and use it in GitHub Desktop.
Polyfill gray() from CSS Color Level 4 with Stylus
/* 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