Created
June 3, 2023 22:57
-
-
Save Hypercubed/c6b13039cd0dfd41787c941f5c6a17ae to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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:map'; | |
$tokens: ( | |
'red': #ff0000, | |
'blue': #00ff00, | |
'green': #0000ff | |
); | |
$mixins: (); | |
@mixin define-mixin($name) { | |
$internal-name: inline-#{unique-id()}; | |
$mixins: map.set($mixins, $name, $internal-name) !global; | |
@at-root { | |
%#{$internal-name} { | |
@content; | |
} | |
} | |
} | |
@mixin apply-mixin($name) { | |
$internal-name: map.get($mixins, $name); | |
@extend %#{$internal-name}; | |
} | |
@include define-mixin('test1') { | |
color: map.get($tokens, 'red'); | |
background-color: map.get($tokens, 'green'); | |
} | |
.element { | |
@include apply-mixin('test1'); | |
} |
This file contains 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
.element { | |
color: #ff0000; | |
background-color: #0000ff; | |
} |
This file contains 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": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment