Skip to content

Instantly share code, notes, and snippets.

Avatar

Antonio Bianchetti seuck

  • Netcentric
  • Barcelona
View GitHub Profile
@certainlyakey
certainlyakey / library.scss
Last active Jun 30, 2021
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' {
$hex: str-slice(ie-hex-str($string), 4);
$string:unquote("#{$hex}");
}
$string: '%23' + $string;
@return $string;
}