Skip to content

Conversation

@zyyv
Copy link
Member

@zyyv zyyv commented Jan 12, 2026

close #5042

Copilot AI review requested due to automatic review settings January 12, 2026 06:43
@zyyv zyyv requested a review from antfu as a code owner January 12, 2026 06:43
@netlify
Copy link

netlify bot commented Jan 12, 2026

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit 4a90ff3
🔍 Latest deploy log https://app.netlify.com/projects/unocss/deploys/69649d80b22d5400084b4de6
😎 Deploy Preview https://deploy-preview-5057--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zyyv zyyv added this to the 66.6.0 milestone Jan 12, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 12, 2026

Open in StackBlitz

commit: 4a90ff3

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new allLayers option to the outputToCssLayers configuration, allowing users to output all defined CSS layer names in the @layer declaration, even if some layers don't contain any actual CSS rules. This is useful for establishing the complete layer cascade order upfront in CSS.

Changes:

  • Added allLayers boolean option to OutputCssLayersOptions interface
  • Refactored layer sorting logic into a reusable sortLayers function
  • Modified getLayers to output all layers from config.layers when allLayers is true

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages-engine/core/src/types.ts Added allLayers option type definition and JSDoc documentation
packages-engine/core/src/generator.ts Implemented allLayers logic by refactoring layer sorting and conditionally using all config layers
packages-engine/core/test/use-css-layer.test.ts Added comprehensive test case for the new allLayers feature
packages-engine/core/test/snapshots/use-css-layer.test.ts.snap Added snapshot showing expected output with all layers declared

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zyyv
Copy link
Member Author

zyyv commented Jan 12, 2026

@copilot What do you think of the name of this new option? Do you have any suggestions?

Copy link
Contributor

Copilot AI commented Jan 12, 2026

@zyyv I've opened a new pull request, #5058, to work on those changes. Once the pull request is ready, I'll request review from you.

@zyyv zyyv merged commit b55b462 into main Jan 12, 2026
11 of 12 checks passed
@zyyv zyyv deleted the core-output-all-layernames branch January 12, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ordering custom CSS layers

2 participants