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

Adds extra parenthesis. #41

Closed
carterworks opened this issue Oct 12, 2018 · 3 comments
Closed

Adds extra parenthesis. #41

carterworks opened this issue Oct 12, 2018 · 3 comments
Labels

Comments

@carterworks
Copy link

Formatting the code adds an extra set of parenthesis, without end.

Here's a test case

div {
  $width = 50;
  height: '%spx' % ($width / 2);
  width: '%spx' % $width;
  drop-shadow: '%spx %spx %spx green' % ((($width / 2) - 2) ($width - 4) ($width - 4));
}

Formatting it three times results in this:

div {
  $width = 50;
  height: '%spx' % ($width / 2);
  width: '%spx' % $width;
  drop-shadow: '%spx %spx %spx green' % ((($width / 2) - 2) (((($width - 4)))) (((($width - 4)))));
}

When the string interpolation argument are not wrapped in parenthesis, like the block below, this bug doesn't happen:

div {
  $width = 50;
  height: '%spx' % ($width / 2);
  width: '%spx' % $width;
  drop-shadow: '%spx %spx %spx green' % (($width / 2) - 2) ($width - 4) ($width - 4);
}
@ThisIsManta
Copy link
Owner

Thanks for reporting the bug. I'll take care of this tomorrow.

@ThisIsManta
Copy link
Owner

This is actually a bug from Stylus compiler (out of my scope), where the compiler generates an extra Expression node in a nested Expression.
However, I can manage to find a workaround and patch this in Stylus Supremacy. Please upgrade to version 2.12.7.

@carterworks
Copy link
Author

Thanks for getting a work around done so quickly.
Do you think an issue on the Stylus repo would be appropriate?

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