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

Not parsing nested or statement correctly #90

Open
sandrodz opened this issue Sep 9, 2022 · 1 comment
Open

Not parsing nested or statement correctly #90

sandrodz opened this issue Sep 9, 2022 · 1 comment

Comments

@sandrodz
Copy link

sandrodz commented Sep 9, 2022

Hello,

I encountered an issue with the following code:

mixin h(level, size = xl, align, margin = true, classes = "")
  class= ((size === "xxl" || size === "xl" || size === "l") && margin) ? "mb-s mb-sS@s" : false

I expected to get:

class=mb-s mb-sS@s

But I actually get:

class=false

Thanks!

@kylekatarnls
Copy link
Member

Hello,

Indeed it's an issue on operator precedence (=== vs ||) on our side, you can use:

mixin h(level, size = "xl", align = null, margin = true, classes = "")
  a(class=(((size === "xxl") || (size === "xl") || (size === "l")) && margin) ? "mb-s mb-sS@s" : false)
+h

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

No branches or pull requests

2 participants