sass-scss-converter icon indicating copy to clipboard operation
sass-scss-converter copied to clipboard

Does not properly work with if-else

Open antsif-a opened this issue 3 years ago • 1 comments

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.

antsif-a avatar Sep 08 '21 18:09 antsif-a

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.

ManuelSch avatar Sep 08 '21 22:09 ManuelSch