Closed romainmenke closed 1 year ago
@romainmenke are you thinking we should release with this warning for @supports
, or is this just a temporary measure until we add support after refactoring?
are you thinking we should release with this warning for @supports, or is this just a temporary measure until we add support after refactoring?
I am hoping it is temporary. But I want to keep the code base healthy after each change and I would like to keep each change small-ish.
The state in this pull request is something that can be released if needed.
I plan to continue work towards full support for supports
conditions, but this could take a while. It really complicates things that four different types of rules interact (import
, media
, layer
, supports
). With layer
I was able to patch a few existing bits and make it work, but a larger refactor is needed for supports
.
Thank you for the review 🙇
see : https://github.com/postcss/postcss-import/issues/529
supports
conditionsFully implementing supports conditions will require a fairly large refactor and the codebase is already very complex.
I would like to first do a few refactors. This is one of them.
I've added
c8
to ensure that test coverage remains high throughout this process.Initially the parsing algorithm was a simple split:
media
conditionWith
layer
andsupports
something more flexible is needed. I've changed the parsing algorithm to a loop that keeps track of what has been encountered and errors on any unexpected sequences.Any
supports
conditions will give errors:This is a behavior change. Before this PR
supports
conditions would be treated as if they weremedia
conditions, which is also incorrect.Both behaviors are "broken" but after this change CSS authors will receive more meaningful feedback.