Closed m-akinc closed 4 months ago
@ghengeveld after this PR, I also have a change that adds support for :host-context()
. After that, it should be time for a release. 🚀
@ghengeveld seems like this stalled out. Anything I can do to help?
@m-akinc We had a company retreat last week so I was preoccupied. I'll take a look soon.
Dang, seems like this broke a bunch of stories. Could you check it out @m-akinc? Perhaps address it in that follow-up PR?
Dang, seems like this broke a bunch of stories. Could you check it out @m-akinc? Perhaps address it in that follow-up PR?
@ghengeveld Sorry for that! Fix is up in #117. Another PR adding support for :host-context()
will be following shortly. (Update: here it is: #118)
:rocket: PR was released in v3.1.0
:rocket:
The code avoided generating invalid CSS when a rule included
:not()
, but it did not provide correct support for thepseudo-*-all
classes. For example,:not(:hover)
would be transformed to.pseudo-hover-all :not()
, but we would skip writing that rule, because of the invalid (i.e. empty):not()
. The correct rewriting of that rule is:not(.pseudo-hover-all *)
, i.e. "Not a descendant of an element with class.pseudo-hover-all
". Similarly, for shadow DOM styles, we need special logic to turn the example rule into:not(:host(.pseudo-hover-all) *)
.In general, the approach is:
:not(...<pseudo-state>...)
with:not(.pseudo-<state>-all ...)
(or:not(:host(.pseudo-<state>-all) ...)
if for shadow DOM)...<pseudo-state>...
->.pseudo-<state>-all ...
Additionally, the refactoring I did allowed the removal of special logic related to
::slotted()
and:has()
.