You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nested vectors using the Garden parent selector (&) wrapping a descendant combinator () aren't rendered correctly.
Descendant combinators can be used with the :not() CSS selector. The Mozilla Developer Network (MDN) docs have this note with a:not(table a) as an example (<a> elements not inside a <table>):
Description
There are several unusual effects and outcomes when using :not() that you should keep in mind when using it:
...
This selector will match everything that is "not an X". This may be surprising when used with descendant combinators, since there are multiple paths to select a target element. For instance, body :not(table) a will still apply to links inside a <table>, since <tr>, <tbody>, <th>, <td>, <caption>, etc. can all match the :not(table) part of the selector. To avoid this, you can use body a:not(table a) instead, which will only apply to links that are not descendants of a table.
This makes writing style mixins harder since they can't be combined into a single value for other places to consume.
As an extra, letting users use the & selector inside the :not() pseudoclass's selector list with the descendant combinator would be convenient. It would let people write mixins like this:
Nested vectors using the Garden parent selector (
) aren't rendered correctly.
&
) wrapping a descendant combinator (Descendant combinators can be used with the
:not()
CSS selector. The Mozilla Developer Network (MDN) docs have this note witha:not(table a)
as an example (<a>
elements not inside a<table>
):If someone tries to write CSS statements for both
a
anda:not(table a)
as a single value with Garden, they might try something like this:This should result in the following CSS:
Garden, however, renders this instead:
Instead, users need to split the styles across 2 values to avoid using the
&
selector.This makes writing style mixins harder since they can't be combined into a single value for other places to consume.
As an extra, letting users use the
&
selector inside the:not()
pseudoclass's selector list with the descendant combinator would be convenient. It would let people write mixins like this:This would render to this:
The text was updated successfully, but these errors were encountered: