-
-
Notifications
You must be signed in to change notification settings - Fork 955
feat(core): add allLayers option to output all layer names
#5057
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
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
commit: |
There was a problem hiding this 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
allLayersboolean option toOutputCssLayersOptionsinterface - Refactored layer sorting logic into a reusable
sortLayersfunction - Modified
getLayersto output all layers fromconfig.layerswhenallLayersis 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.
|
@copilot What do you think of the name of this new option? Do you have any suggestions? |
close #5042