stylus-supremacy
stylus-supremacy copied to clipboard
parenthesis get added to calculus
Using command line and options:
"stylusSupremacy.insertSpaceInsideParenthesis": false,
"stylusSupremacy.insertParenthesisAfterNegation": false,
"stylusSupremacy.insertParenthesisAroundIfCondition": false,
I'm not expecting parenthesis to be added :
-
barBorderRadius = colorBarHeight / 2
tobarBorderRadius = (colorBarHeight / 2)
-
width 'calc(%s - 20px)' % floor(100%/n)
=>width "calc(%s - 20px)" % floor((100% / n))
-
width calc(100% / 3)
=>width calc((100% / 3))
unfortunately this ends up in the final css too, increasing its size
Thanks for reporting this.
Dealing with parentheses is always a hassle because there is no explicit representation of a parenthesis in Stylus AST generated by Stylus compiler (only nested Expression objects).
I do have a plan to refactor the formatter so it will handle this better, but no ETA though. Please bear with me.
+1 to this :)
Note that if you minify your CSS before shipping it, the extra parentheses are harmless