diff --git a/core/css/functions.scss b/core/css/functions.scss
index 7616441bc1d0f5ad32c75399b04aca7e741c8b05..7489e574e9707d79764a0e96930ba575fe047500 100644
--- a/core/css/functions.scss
+++ b/core/css/functions.scss
@@ -27,9 +27,10 @@
  * @return string The color without #
  */
 @function remove-hash-from-color($color) {
+	$color: unquote($color);
 	$index: str-index(inspect($color), '#');
 	@if $index {
-		$color: str-slice(inspect($color), 0, 1) + str-slice(inspect($color), 3);
+		$color: str-slice(inspect($color), 2);
 	}
 	@return $color;
 }