Skip to content

Instantly share code, notes, and snippets.

@dvdovenko
Created October 13, 2022 11:01
Show Gist options
  • Save dvdovenko/96412c1f3f43b22628510abfaa98ff59 to your computer and use it in GitHub Desktop.
Save dvdovenko/96412c1f3f43b22628510abfaa98ff59 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$txt: #9c9c9c;
$txtColor: '#9c9c9c';
@function safe-quote($param) {
@return if(type-of($param) == string, $param, '#{$param}');
}
@function wrong-safe-quote($param) {
@return if(type-of($param) == string, $param, quote($param));
}
@function safe-unquote($param) {
@return if(type-of($param) == string, unquote($param), $param);
}
@debug safe-quote($txt);
.root {
color: safe-quote($txt);
text-color: safe-unquote($txt);
text-wrong-color: wrong-safe-quote($txt)
}
.root {
color: "#9c9c9c";
text-color: #9c9c9c;
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment