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 new
screen
function to complement the existingtheme
function:This isn't really that useful on its own (we already have the
@screen
directive) but it's a useful part of solving the bigger problem of making Tailwind CSS more easily compatible withpostcss-nested
andpostcss-nesting
.Adding this function will make it possible for us to release our own wrapper libraries around those two plugins that make them behave properly with Tailwind.
This is necessary for
postcss-nesting
because it doesn't support the ability to bubble custom at-rules, and necessary forpostcss-nested
because it has been migrated to the new visitor API which causes it to run in a non-deterministic order relative to other plugins, forcing Tailwind to be "nesting-aware" if it were to ever work properly.postcss-nested
also has several bugs that cause bubbling to not work correctly in several situations for custom at-rules.By providing this helper function, we can write wrappers around those libraries that translate
@screen sm
to@media screen(sm)
, which will make bubbling work correctly. The wrappers can also be used to force the plugins to run in a deterministic order by wrapping the visitor API implementations with a layer that only usesOnce
rather than node type events.