Skip to content

Instantly share code, notes, and snippets.

@TexRx
Forked from LeaVerou/gray.scss
Created February 25, 2014 02:21
Show Gist options
  • Save TexRx/9201453 to your computer and use it in GitHub Desktop.
Save TexRx/9201453 to your computer and use it in GitHub Desktop.
@function gray($intensity, $alpha: 1) {
@return rgba($intensity, $intensity, $intensity, $alpha);
}
/* Thanks Chris Eppstein for simplifying my code! */
/* 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