Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Ovenden keeperofkeys

View GitHub Profile
@keeperofkeys
keeperofkeys / library.scss
Last active Nov 7, 2018 — forked from certainlyakey/library.scss
URL-encode color SASS function / convert color to hex SASS function
View library.scss
//does not work with colors containing alpha
@function encodecolor($string) {
@if type-of($string) == 'color' {
@if $string != transparent {
$hex: str-slice(ie-hex-str($string), 4);
$string:unquote("#{$hex}");
$string: '%23' + $string;
}
}
@return $string;