Skip to content
New issue

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

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

Already on GitHub? # to your account

parenthesis get added to calculus #55

Open
Cactusbone opened this issue Oct 8, 2019 · 2 comments
Open

parenthesis get added to calculus #55

Cactusbone opened this issue Oct 8, 2019 · 2 comments

Comments

@Cactusbone
Copy link

Cactusbone commented Oct 8, 2019

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 to barBorderRadius = (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
@ThisIsManta
Copy link
Owner

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.

@aleclarson
Copy link

+1 to this :)

Note that if you minify your CSS before shipping it, the extra parentheses are harmless

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants