Skip to content

Instantly share code, notes, and snippets.

@hudri
hudri / library.scss
Created May 7, 2018 09:16 — forked from certainlyakey/library.scss
URL-encode color SASS function / convert color to hex SASS function
//does not work with colors containing alpha
@function encodecolor($string) {
@if type-of($string) == 'color' {
$hex: str-slice(ie-hex-str($string), 4);
$string:unquote("#{$hex}");
}
$string: '%23' + $string;
@return $string;
}