We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Issue: no color is applied in the example below.
https://mint-lang.com/sandbox/kCgrWZIMx8CVeA
type Edge { Start Middle End } component Main { fun render : Html { <div> <p::test(Edge.Start)>"Hello Wold!"</p> <p::test(Edge.Middle)>"Hello Wold!"</p> <p::test(Edge.End)>"Hello Wold!"</p> </div> } style test(edge : Edge) { case edge { Start => { color: red; } Middle => { color: green; } End => { color: brown; } } } }
The workaround is to use ifs:
if
style test2(edge : Edge) { if edge == Edge.Start { color: red; } else if edge == Edge.Middle { color: green; } else if edge == Edge.End { color: brown; } }
The text was updated successfully, but these errors were encountered:
This is a case where you would expect it to be parsed as one thing, but it's parsed as another.
In your code, the case is parsed as a selector and will be compiled to:
case
.Main_test case edge Start => { color: red; } .Main_test case edge Middle => { color: green; } .Main_test case edge End => { color: brown; }
Basically, the case edge is one selector and each branch is a nested selector.
case edge
Removing the blocks to make it work:
style test (edge : Edge) { case edge { Start => color: red; Middle => color: green; End => color: brown; } }
I'm not sure how to resolve this, there are a couple of solutions:
Start =>
I'll try to do 2. for now and see it that solves this issue.
Sorry, something went wrong.
37380a6
No branches or pull requests
Issue: no color is applied in the example below.
https://mint-lang.com/sandbox/kCgrWZIMx8CVeA
The workaround is to use
if
s:The text was updated successfully, but these errors were encountered: