-
Notifications
You must be signed in to change notification settings - Fork 61
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
CSS selectors with multiple rules redeclared in media queries results in multiple blocks #109
Comments
@runar Please add the actual output and expected output to the issue description |
I apologize, I submitted the issue a bit too early by mistake. I’ve updated the first comment now, with expected and actual output! |
@runar This looks like it stems from the same problem as #67 so I am going to close in favor of that You can fix the rule order with There isn't an existing issue for indentation weirdness. Not too high priority compared to the bugs in this project |
@MadLittleMods Would you be able to point me in the right direction to fix this? I lack the skills to debug this on my own, but I’ll give it a shot if you help me out with what files or functions might be the culprit. For the record, this change by @codyhouse seems to fix issue #67, but not the issue reported here. |
@runar All of the logic would be in these files, But it probably won't be very straightforward to fix |
@MadLittleMods You’re right, so instead of spending the entire weekend on this, I’ll be happy with my own solution: Use PostCSS and cssnano (the mergeRules optimisation) to merge the media queries into one. Thank you for responding so quickly! |
I believe this issue is related to both #64 and #67, but it’s not quite the same as no duplication is involved.
If a CSS selector has multiple rules that are redeclared by the same media query, multiple media queries will be outputted with only one rule each. Take a look at the following example from the playground:
Input:
Expected:
Actual output:
(Also notice how the rule order is reversed, indention is wrong, and an empty line is added below the media queries.)
The text was updated successfully, but these errors were encountered: