ThisIsManta / stylus-supremacy

A Node.js script that helps formatting Stylus files.
https://thisismanta.github.io/stylus-supremacy
MIT License
88 stars 9 forks source link

Formatting breaks certain kinds of interpolation #76

Open jakewski opened 4 years ago

jakewski commented 4 years ago

Hello, love stylus-supremacy and really grateful for this project.

I found some weird interpolation issues when trying to add this as an autofixer for a large codebase.

  1. Perenthesis + %
    
    $padding = 12

.class1 padding ($padding)%


gets formatted to:

$padding = 12;

.class1 { padding: $padding %; }


which doesn't compile.

2. Interpolated mixin

text-blue() color blue

.class1 text-{'blue'}() transform ($padding)ms


turns into

text-blue() color blue

.class1 text-{'blue'} transform $padding ms


and if you run it again, it turns into:

text-blue() color blue

.class1 text-

transform $padding ms



Thanks in advance for your time. Again, love this project
Shyam-Chen commented 4 years ago

45