Repository navigation
Don't drop the rest of a media query when migrating screen(…) - #20774
Open
NotAFlightRisk wants to merge 1 commit into
Open
NotAFlightRisk wants to merge 1 commit into
NotAFlightRisk wants to merge 1 commit into
Conversation
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.
Summary
Upgrading a v3 stylesheet with
@media screen(md) and (orientation: landscape)gives you@media (width >= theme(--breakpoint-md)), so the orientation condition is just dropped. The codemod swaps the whole media query for the breakpoint, where v3 only ever replaced thescreen(…)call. And since v4 doesn't supportscreen()at all, nothing catches it once the file's been rewritten.Now it only replaces the
screen(…)calls, which also keeps theprintin@media print, screen(lg). Screens it can't resolve are left alone like before.Test plan
Added a test for
screen(md) and (orientation: landscape). It fails onmainand passes with the fix, along with the other tests in the file: