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
mergeRules should not merge unknown pseudo selectors #642
Comments
I've recently come across this issue myself and I'm wondering if it's currently possible to disable optimisations on a line-by-line basis? E.g. like ESLint's |
@saulhardman no, it is hard to implement using comments, but PR welcome |
@evilebottnawi I figured as much, thanks for your response 👍 |
@evilebottnawi We have a system for handling mergeable pseudo elements here: Perhaps this should be changed; currently this list prevents a merge for known pseudo selectors, but allows unknown ones through. If we only allow a merge on known pseudo selectors, we will have less bug reports on broken behaviour and hopefully more reports of acceptable pseudo selector merging. In any case this is a matter of adding |
Good idea, can you take care about this? |
@evilebottnawi Probably easier if we fix the immediate bug and then can look into changing behaviour later? |
Sounds good, need open issue about this or update currently |
|
are you using the nightly ? cause this has been fixed in #882 but not released yet. |
no it wont (in the master). ref this https://github.com/cssnano/cssnano/blob/a4b38cbfaf/packages/postcss-merge-rules/src/__tests__/index.js#L790 |
Ah, I was confused, I understand the issue now (before all unknown selectors were merged, and |
once #954 is done. In the meantime use |
It appears that if a browser (tested in Chrome 69, Firefox 60, Safari 12, Edge 16) does not recognize a pseudo selector, it drops the entire selector, including any combined selectors.
Example:
https://codepen.io/anon/pen/ZqxNEq
The text was updated successfully, but these errors were encountered: