Add first-class support for height media/container queries #13389
+378
−1
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.
This is a follow-up to closed PRs #11217 and #11225 (third time's a charm, right?)
I accounted for the latest changes recommended by @adamwathan here, specifically regarding syntax.
Syntax:
min/max-h-[…]:
sm:
(already supported,min
andwidth
assumed)min-sm:
(already supported,min
explicit,width
assumed)h-sm:
(✨NEW✨,min
assumed,height
explicit)min-h-sm:
(✨NEW✨,min
andheight
explicit)w-sm:
(🚫 NOT SUPPORTED,min
assumed,height
explicit) 1min-w-sm:
(🚫 NOT SUPPORTED,min
andheight
explicit) 1Thankfully, in the
next
branch, most support for dimension-specific sorting and inversion appears to already be supported out of the box, as do container queries, so we may even be able to close this related issue as well once v4 goes live, assuming thetailwindcss-container-queries
plugin will also be sunset at that time.Next step(s) — feedback / testing
I'm sure we'll still want to add a few tests here, especially for cases where height and width queries are mixed, and consider how we want those to sort (e.g. inner-most variants first vs. width-first always, etc.), but I wanted to get this PR in quickly so we can hopefully include it in the v4.0.0 launch.
If someone from the core team could poke around at my existing tests, maybe try blowing my impl up or throwing in some wonky examples to stress test it, that would help to find any glaring bugs. It would also help to take a peek at the updated snapshots to make sure all the updated bits look correct.
Footnotes
Note: I considered adding
min-w-
explicitly as well, but thought it might be best not to have two variants that do the same thing (min-w-
vs.min-
). Let me know if you want to support both, with the shorthand as an alias for the explicit. Should be a quick change. ↩ ↩2