-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Nested @media transformed incorrectly for pseudo elements #4164
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
Comments
Initially it seems that disabling the transformation (by using the versions listed here: https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector#browser_compatibility) would work for us. We however found out that these numbers are incorrect (at least for Safari). The 17.3 version does not handle nesting correctly in some cases. |
@evanw Would you accept a pull request for this? If so, if you have any pointers on where to start, that would greatly help :-D |
Removing the // if !sel.UsesPseudoElement() {
parentSelectors = append(parentSelectors, css_ast.ComplexSelector{Selectors: substituted})
// } It's great to see this is covered by the tests. I'll have to trace the flow of the application to see if we can easily distinguish between the different scenario's. |
I have the following
css
:I am using the following code to transform it:
The result is the following:
As you can see it created these rules:
Here the selector inside of
@media
is missing.I was expecting something more like this:
I am not sure if this is an easy fix. I did not dig into the source code too much (and have no experience in Go). On top of that I am not sure if we can simply switch the target to browsers that support nesting.
In any case, if it is an easy fix all good. If it is not easy, please give me a few pointers that would allow me to do the work and submit a pull request (if we need to actually support older browsers).
The text was updated successfully, but these errors were encountered: