Created
July 11, 2022 10:12
-
-
Save Kjaer/f96d199e447dfb865f7cf38fe3bde6c1 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@use "sass:selector"; | |
@use "sass:string"; | |
@use "sass:map"; | |
.alert{ | |
$alert-class: & !global; | |
color: green; | |
display: flex; | |
border: 1px solid yellow; | |
} | |
.button { | |
$button-class: & !global; | |
border: none; | |
color: blue; | |
} | |
@function syntax-class-generator($component-class) { | |
@return string.insert("#{$component-class}", $prefix, 2), | |
} | |
$prefix: "syn_"; | |
$syntax_components: ( | |
"alert": string.insert("#{$alert-class}", $prefix, 2), | |
"button": string.insert("#{$button-class}", $prefix, 2), | |
"avatar": syntax-class-generator(".avatar"), | |
); | |
#{map.get($syntax_components, "alert")}__open { | |
display: block; | |
} | |
#{map.get($syntax_components, "button")}__open { | |
display: block; | |
} | |
#{map.get($syntax_components, "avatar")}__open { | |
display: block; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.alert { | |
color: green; | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
border: 1px solid yellow; | |
} | |
.button { | |
border: none; | |
color: blue; | |
} | |
.syn_alert__open { | |
display: block; | |
} | |
.syn_button__open { | |
display: block; | |
} | |
.syn_avatar__open { | |
display: block; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment