-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Simpler support for responsive components and style layers #2031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
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
Still wrong but less wrong
thecrypticace
added a commit
that referenced
this pull request
Jun 5, 2025
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request. ### What changed? #### ✳️ postcss (8.5.3 → 8.5.4) · [Repo](https://github.com/postcss/postcss) · [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) <details> <summary>Release Notes</summary> <h4><a href="https://github.com/postcss/postcss/releases/tag/8.5.4">8.5.4</a></h4> <blockquote><ul dir="auto"> <li>Fixed Parcel compatibility issue (by <a href="https://bounce.depfu.com/github.com/git-sumitchaudhary">@git-sumitchaudhary</a>).</li> </ul></blockquote> <p><em>Does any of this look wrong? <a href="https://depfu.com/packages/npm/postcss/feedback">Please let us know.</a></em></p> </details> <details> <summary>Commits</summary> <p><a href="https://github.com/postcss/postcss/compare/22c309d32924e1eeb33c80a6a50b7ba8a43a1832...6cb4a6673fb6d8b23eb1ebe66a22b6267ab141de">See the full diff on Github</a>. The new version differs by 23 commits:</p> <ul> <li><a href="https://github.com/postcss/postcss/commit/6cb4a6673fb6d8b23eb1ebe66a22b6267ab141de"><code>Release 8.5.4 version</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/ec5c1e031083664bed1cf91eaac72f8c61068110"><code>Update dependencies</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/e85e9385c87499bc7e274c6ce332cf59e3988994"><code>Fix code format</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/50542335f22e513edaa52cb8bd214370ceef1bc9"><code>fixed error at line 401 (#2046)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/0538b6309e5ca80044bc8ca34833db422bbaa9fe"><code>docs: Update README.md (#2044)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/b5f407f3976419310bcc530043f5835b7192f41c"><code>Add `postcss-fontsource-url` to plugins (#2043)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/94b5260be6fd43f230cc4dd91a7d3c51b09a0e94"><code>Clarify documentation for `node.source.end.offset` (#2032)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/a20724af14ad05304f99ced858f6f2f47f4a1633"><code>Fix Markdown syntax</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/cf6b9697519aa0a9feda3b3468a738ba8870b61b"><code>fix: add a mention for postcssense extension (#2040)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/ff48c29ebb16339188761827701e832f516bfb7d"><code>Increase size</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/f82c2a60906ee889be26fe8e7e37d90fca23224e"><code>Add `Input#fromLineAndColumn`, `CssSyntaxError.input.offset` and `CssSyntaxError.input.endOffset` (#2034)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/7892a29ff8492f11cf2ce07f9aa17def26f96338"><code>Fix missing offset in `Node#positionInside`, `Node#positionBy` and `Node#rangeBy` (#2033)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/875f1fb7f863a859d16261b0a24a5823e7a6c40d"><code>Fix `opts` argument of `Node#rangeBy()` and `Node#positionBy()` cannot be omitted (#2031)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/25443a59303678426e521fdb434bf95f4925ca14"><code>Update dependencies</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/0a76df5f60511cb577374f869942e5a52d976666"><code>add postcss-auto-var-fallback fallback plugin to plugins.md (#2026)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/3fc6388e91d496105f5a8fe63ab22a9a5a3c5254"><code>Update Nano ID</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/368bd0092000f01f6e873d9f55ef3c93a9149217"><code>Change in type definition of property `css` of `result` (#2025)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/9229218b515eaffcd6f5c6bacdee766f27262ebc"><code>Update dependencies</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/6c2a808c4ac483317be2a906b5ee6d168a16568c"><code>Clean up code</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/31a5de71d12f16aa31092c86106cd6f181bd1250"><code>Return type of method `raw` of `Stringifier` can be boolean, as the property `semicolon` can be boolean (#2024)</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/c5058912f2659f2c81ec7ccf04408fd4f25e4fc0"><code>There are no other `props` with non-string type.</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/a9cf39e7fe864e87d91d56511fd594a0dc0fbdf5"><code>The return type of the method rawValue in Stringifier should be `any` instead of `string`</code></a></li> <li><a href="https://github.com/postcss/postcss/commit/7ac43db0c30c08dc799a55e5f2f1f269a61b6856"><code>Update ESLint config</code></a></li> </ul> </details> ---  [Depfu](https://depfu.com) will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with `@depfu rebase`. <details><summary>All Depfu comment commands</summary> <blockquote><dl> <dt>@depfu rebase</dt><dd>Rebases against your default branch and redoes this update</dd> <dt>@depfu recreate</dt><dd>Recreates this PR, overwriting any edits that you've made to it</dd> <dt>@depfu merge</dt><dd>Merges this PR once your tests are passing and conflicts are resolved</dd> <dt>@depfu cancel merge</dt><dd>Cancels automatic merging of this PR</dd> <dt>@depfu close</dt><dd>Closes this PR and deletes the branch</dd> <dt>@depfu reopen</dt><dd>Restores the branch and reopens this PR (if it's closed)</dd> <dt>@depfu pause</dt><dd>Ignores all future updates for this dependency and closes this PR</dd> <dt>@depfu pause [minor|major]</dt><dd>Ignores all future minor/major updates for this dependency and closes this PR</dd> <dt>@depfu resume</dt><dd>Future versions of this dependency will create PRs again (leaves this PR as is)</dd> </dl></blockquote> </details> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> Co-authored-by: Jordan Pittman <[email protected]>
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 is an alternate approach to what was presented in #2025.
This PR adds first-class support for variants for "component" styles. It differs from #2025 in the following ways:
Component and utility responsive styles are intermingled
Rather than inserting all responsive component styles, then all responsive utility styles, this PR groups them together by screen size.
So the general order in the CSS is this:
sm
component stylessm
utility stylesmd
component stylesmd
utility styleslg
component styleslg
utility stylesxl
component stylesxl
utility stylesThis leads to more intuitive results when combining components and utilities at various breakpoints.
No
@screens components/utilities
directivesBecause of the change explained above, there is no need to introduce
@screens components/utilities
. Instead, we are keeping@tailwind screens
, since all responsive styles are now zipped together per screen size, no matter what layer (components/utilities) they belong to.No
@responsive components { ... }
syntaxThe argument for the
@responsive
at-rule has been removed. Now any responsive variants generated using theaddComponents
API are just automatically categorized as components, so this doesn't need to be done explicitly.No support for children in
@tailwind
directivesSupport for things like this have been removed:
While I think this is still a useful idea at a high level, this implementation had the problem of not allowing you to split your styles into multiple files, because this is invalid syntax using postcss-import:
New
@layer
directive has been addedA new
@layer
directive has been introduced as a better solution to nesting children within@tailwind components { ... }
.It looks like this:
This lets you "bucket" your custom styles into the right "layer" (term comes from ITCSS) so Tailwind can mark them appropriately and purge them properly based on your purge
mode
configuration.You can nest
@variants
and@responsive
directives within@layer
directives to make sure all generated variants are also categorized correctly:I probably won't document this for a while because it's more of an implementation detail than a feature, but this is how you'd properly bucket things in custom CSS if you aren't using the plugin system instead.
Risks
I don't think there's any real issues here — there were some tricky internal tweaks necessary to get everything working but all of the tests are passing so things seem good. The closest thing to an alarm-sounding issue I ran into was that for a minute
@apply
stopped working because every generated Tailwind style was nested under a@layer
, and@apply
doesn't support applying classes that are nested under another rule. Flattening the layers to control comments before substituting@apply
at-rules was enough to fix it, but does make me slightly nervous there could be other similar types of issues that crop up.Nevertheless I feel very confident in our test suite, so since everything is passing I would be very surprised if we ran into an issue that wasn't solvable.
This fixes an important issue in the Tailwind Typography plugin so I'd like to get this merged and released as v1.5 (sadly a waste of a good version number) today pending any problems anyone points out 👍