Merged
Conversation
adamwathan
previously requested changes
Oct 5, 2024
Member
adamwathan
left a comment
There was a problem hiding this comment.
Nice! I think this should use the theme function instead of inlining the raw value though.
81b4998 to
28b2c1a
Compare
Member
Author
|
Made some updates:
Also tried with an alternative using |
232e078 to
8d1576d
Compare
thecrypticace
approved these changes
Oct 10, 2024
In other cases, or using legacy JS object syntax, we can't use the `theme(…)` function, therefore we fully expand the media query in your CSS.
This reverts commit a1113f8. This is way too experimental and no browser implements this feature yet. See: https://caniuse.com/?search=custom-media We can use lightningcss that transpiles is properly, but in environments such as the CDN we don't have access to lightningcss.
8d1576d to
dc85269
Compare
Made sure that we use theme(…) in the simple cases and expand to the full @media if we can't use theme(…)
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.
This PR adds a codemod that migrates the
@media screen(…)to the properly expanded@media (…)syntax.Will be converted to:
If you happen to have custom screens (even complex ones), the screen will be converted to a custom media query.
With a custom
tailwind.config.jsfile with a config like this:Then the codemod will convert it to: