Hey guys ! Just want to raise awareness about this...
# compose-web
s
Hey guys ! Just want to raise awareness about this issue, which I feel is quite critical : https://github.com/JetBrains/compose-jb/issues/1241
🙏 2
👍 4
l
Happened to me as well. I was about to comment here and got surprised by the solution lol
Having to write descendant was not intuitive at first
a
Thanks for report! Will fix it this week!
but you can use
self
explicitly here to workaround
l
What is the workaround?
a
something like
Copy code
self + " h1" {
 …
}
should work
l
Ah, that space!
I was missing the space
Was trying just self + "h1" {}
Any chance we could replace
combine
to add that space by default? I doubt anyone combining selectors want to join them as a single string without any spacing
a
but
self + "h1"
mean something like
"&h1"
, which is valid case…
BTW we have
descendant
combinator for that
Copy code
descendant(self, "h1")
maybe it could be just
desc(self, "h1")
l
but
self + "h1"
mean something like
"&h1"
, which is valid case… (edited)
Ah, I see. I didn't know that
In CSS
a > h1
is valid, isn't it?
We could overload the
>
operator if we want to make it similar
a
I will think about operator overloading. We need to do it carefully to avoid ambiguity.
Now you can use
child
combinator for that.
child(self, "h1")
l
self desc "h1" { } could work too
Instead of operator, just infix. It's way less ambiguous
a
Will play with different solutions. Thanks for highlighting.
👍 1
c
The most kotlin-like operator for descendants is probably
/