-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Plugin does not work with media queries nested inside selectors #324
Comments
Hi @MaciejZajac, That is correct, putting a media-query containing only declarations inside a rule is a valid SASS code. But even if this plugin has a basic support for rules inside media-queries it does not do the entire job that Dart-sass does, that is not the purpose of this plugin and it will never be.
Regards |
Hi @MaciejZajac, |
Thanks @elchininet Would you accept contributions to fix it? And can you give pointers on where this could be fixed in the codebase if it was to be fixed? I'd love to assess effort |
Thanks @louy, I knew that the proposal was ongoing but I didn't know that the support right now is above 85% and it has become a new baseline since December. Contributions are always welcomed, but implementing it would be a bit hard to achieve, just because the way in which the plugin works at the moment. It expects that inside an at-rule could be rules or other at-rules, but not declarations. If it the declarations parser is run inside the at-rules, then the parser itself needs to be refactored to allow this togeteher with all the store logic that expects to contain rules that needs to be flipped because their declarations were flipped (in this case they should be rules that should be flipped because any at-rule at any level inside it contains declarations that have been flipped). All of this should be done taking into account all the logic that this plugin provides to deal with overriden properties and avoid a rule being overriden because specificity of prefixed rules, in this case it should do the same but taking into account any at-rule nested inside a rule. If you come with an easy solution to deal with this, I would be happy to discusss it and help you to get it implemented. Regards |
@louy, |
Hello @elchininet so do i get this correctly plugin will strugle with css that has some simple media queries ? Is there a configuration that will go inside this nested Example: @media (min-width: 960px) { is beeing transformed to: `[dir="ltr"] .navigation__item { [dir="rtl"] .navigation__item { @media (min-width: 960px) { And this new code creates an issue with |
Hi @mjuniquecode, |
Plugin doesn't seem to add a prefix when there is a media query nested in a selector .
expected:
actual:
According to this nested media is a valid css
postcss/postcss-nested#141
Playground link
https://elchininet.github.io/postcss-rtlcss/#662f7595f2033
The text was updated successfully, but these errors were encountered: