Skip to content

Instantly share code, notes, and snippets.

@karlstolley
Created October 19, 2012 03:04
Show Gist options
  • Save karlstolley/3916003 to your computer and use it in GitHub Desktop.
Save karlstolley/3916003 to your computer and use it in GitHub Desktop.
RGB/RGBa in Sass
// Declare the color as RGB; SASS will treat this as hex
$green: rgb(27,224,63);
// Declare an alpha
$alpha: .5;
// Declare another color variable as a color with an alpha
$greenAlpha: rgba($green, $alpha);
body {
/* As RGB (which SASS actually ouputs as HEX) */
background: $green;
/* With RGBa syntax */
background: rgba($green, $alpha);
/* Or as a simple variable with RGBa */
background: $greenAlpha;
}
@alpanjel
Copy link

thanks

@willdow
Copy link

willdow commented Jan 24, 2019

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment