sass-scss-converter
sass-scss-converter copied to clipboard
Does not properly work with if-else
Input SCSS:
@mixin centered($horizontal: true, $vertical: true) {
position: absolute;
@if ($horizontal and $vertical) {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} @else if ($horizontal) {
left: 50%;
transform: translate(-50%, 0);
} @else if ($vertical) {
top: 50%;
transform: translate(0, -50%);
}
}
Output Sass:
@mixin centered($horizontal: true, $vertical: true)
position: absolute
@if ($horizontal and $vertical)
top: 50%
left: 50%
transform: translate(-50%, -50%)
left: 50%
transform: translate(-50%, 0)
top: 50%
transform: translate(0, -50%)
The output lacks some else-if
-s.
Thanks for your report.
I'll take a look at the issue and keep you updated. In the meantime, feel free to open a pull request in case you'd like to add your own quick fix.