Conversation
07a99a0 to
f5883c4
Compare
RyanZim
approved these changes
Jun 7, 2025
Collaborator
|
Will release next week |
Collaborator
|
Actually, there's no good reason for me to be the bottleneck for npm releases; @romainmenke I should add you on npm; just to confirm, you're https://www.npmjs.com/~romainmenke there? |
Collaborator
Author
|
Yes, that's me :) |
Collaborator
|
@romainmenke Invitation sent; feel free to push the version bump/CHANGELOG update directly to master. |
Collaborator
Author
|
Thank you @RyanZim, I've released a new version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the original problem described in #567 (comment)
The root cause is that all nodes are added to either the
importsorbundlearray inpostcss-import/lib/parse-styles.js
Lines 36 to 37 in d43ca15
While
@layerstatements (those without a rule body) can precede@import.To fix this issue I've added a new statement type for layers and added the needed mechanics to apply conditions to these. To express conditional
@layerstatements before other@importstatements, or@layerstatements that end up in between other@importstatements we use base64 encoded stylesheets:@import 'data:text/css;base64,QGxheWVyIGxheWVyLWJldGE=' print;is equivalent to@media print { @layer layer-beta }but is valid before other@importstatementsI am unsure if it fixes all other reported examples as I don't have reproductions for those. I suggest they test out the fix (if/when it lands) and file new issues if they still encounter problems.
I verified the fix by re-testing with https://github.com/romainmenke/css-import-tests
With the patch applied 4 more test cases pass, without regressions in other cases.