Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting removes parentheses and breaks compiled attribute #25

Closed
dominikb opened this issue Sep 16, 2018 · 2 comments
Closed

Formatting removes parentheses and breaks compiled attribute #25

dominikb opened this issue Sep 16, 2018 · 2 comments
Labels

Comments

@dominikb
Copy link

dominikb commented Sep 16, 2018

Issue

I am using a property lookup to style a text-shadow. Formatting the file removes the parentheses and adds a whitespace.
Thus the stylus compiler interprets the line as expression and subtracts both values, resulting in an invalid CSS property.

Expected Result

The parentheses do not get removed as this changes the outcome.
The expression should result in -4rem.

VSCode Extension Configuration

{
  // ...
  "stylusSupremacy.insertBraces": false,
  "stylusSupremacy.insertLeadingZeroBeforeFraction": false,
  "stylusSupremacy.insertColons": false,
  "stylusSupremacy.insertSemicolons": false,
  "stylusSupremacy.sortProperties": "alphabetical",
  "stylusSupremacy.selectorSeparator": ","
}

Example

h1
  font-size 4rem
  text-shadow 2rem (-@font-size) #fff

becomes

h1
  font-size 4rem
  text-shadow 2rem - @font-size #fff

Compiled CSS Ouput

Expected

h1 {
text-shadow: 2rem -4rem #fff;
}

Actual

h1 {
text-shadow: -2rem #fff;
}
@ThisIsManta
Copy link
Owner

Thank you for reporting this issue. Please spare me some time to fix.

@ThisIsManta
Copy link
Owner

Fixed at v2.12.5

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants