fix(preset-mini): revert base perspective in transform#5120
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the base perspective handling in the transform CSS property for the preset-mini package. Previously, perspective(var(--un-perspective)) was included in every transform by default, even when no perspective was set. This PR removes it from the base transform and only includes it when explicitly set via transform-perspective-xxx utilities.
Changes:
- Removed
perspective(var(--un-perspective))from the base transform string to avoid unnecessary perspective function calls - Modified
transform-perspective-xxxrule to usevar(--un-perspective)directly in the transform property instead of wrapping it inperspective() - Updated all test snapshots to reflect the corrected behavior
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages-presets/preset-mini/src/_rules/transform.ts | Core fix: removed perspective from base transform array; updated transform-perspective rule to use var directly |
| test/transformer-compile-class.test.ts | Updated test snapshot to remove perspective from base transform |
| test/cases/preset-attributify/case-4/output.css | Updated test snapshot for attributify preset transforms |
| test/cases/preset-attributify/case-2/output.css | Updated test snapshot for peer-state transforms |
| test/cases/preset-attributify/case-1/output.css | Updated test snapshot for basic transforms |
| test/assets/output/transformer-directives-apply.css | Updated test snapshot for apply directive transforms |
| test/assets/output/transformer-directives-apply-with-important.css | Updated test snapshot for apply with important transforms |
| test/assets/output/preset-wind3-targets.css | Updated test snapshot for wind3 preset transforms |
| test/assets/output/preset-wind3-important-true.css | Updated test snapshot for wind3 with important flag |
| test/assets/output/preset-wind3-important-string.css | Updated test snapshot for wind3 with important selector |
| test/assets/output/preset-wind3-empty-prefix.css | Updated test snapshot for wind3 with empty prefix |
| test/assets/output/preset-wind3-custom-var-prefix.css | Updated test snapshot for wind3 with custom var prefix |
| test/assets/output/preset-mini-targets.css | Updated test snapshot for mini preset transforms, including transform-perspective-9cm |
| test/assets/output/preset-mini-empty-prefix.css | Updated test snapshot for mini with empty prefix |
| test/assets/output/preset-mini-custom-var-prefix.css | Updated test snapshot for mini with custom var prefix |
| test/snapshots/postcss.test.ts.snap | Updated postcss test snapshot |
| packages-integrations/svelte-scoped/src/_preprocess/transformClasses/test-outputs/EverythingProd.svelte | Updated svelte production output snapshot |
| packages-integrations/svelte-scoped/src/_preprocess/transformClasses/test-outputs/EverythingDev.svelte | Updated svelte development output snapshot |
| packages-integrations/runtime/test/assets/output/runtime-preset-tagify.css | Updated runtime tagify preset snapshot |
| packages-engine/core/test/postprocess.test.ts | Updated postprocess test snapshot |
| packages-engine/core/test/assets/output/shortcuts-transform-duplicated.css | Updated shortcuts transform test snapshot |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
commit: |
Related to #5114