I am creating a SCSS -> HTML plugin and need to first render SCSS -> CSS while keeping the nesting so I can then parse with PostCSS to then create an HTML tree with.
I would like to render SCSS like this
// myMixin.scss
@mixin myMixin {
.myMixin {
padding: 1rem;
background: yellow;
}
}
// main.scss
@import 'myMixin.scss';
$blue: #004AAD;
.button {
.text {
color: $blue;
}
@include myMixin;
}
And the output would look like this:
.button {
.text {
color: #004AAD;
}
.myMixin {
padding: 1rem;
background: yellow;
}
}
Basically, I'd like a way to render everything in SCSS while keeping the original nesting. Is it possible? Thanks.