Fix whitespace-only custom property with !important (#20055)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-09-14 15:03:09 +08:00
1 parent d00ebd11d6
commit 475893a105
5 files changed
+59 -3

No files matched your search

@@ -2,17 +2,41 @@
exports[`important.css format 1`] = `
====================================options=====================================
parsers: ["css"]
parsers: ["css", "less", "scss"]
printWidth: 80 (default) |
=====================================input======================================
div {
max-height: none !important;
}
a {
--x11:!important;
--x12: !important;
--x13: !important;
--x21:;
--x22: ;
--x23: ;
--x31:x!important;
--x32:x !important;
--x33:x !important;
}
=====================================output=====================================
div {
max-height: none !important;
}
a {
--x11:!important;
--x12: !important;
--x13: !important;
--x21:;
--x22: ;
--x23: ;
--x31: x !important;
--x32: x !important;
--x33: x !important;
}
================================================================================
`;
+1 -1
View File
@@ -1 +1 @@
runFormatTest(import.meta, ["css"]);
runFormatTest(import.meta, ["css", "less", "scss"]);
+12
View File
@@ -1,3 +1,15 @@
div {
max-height: none !important;
}
a {
--x11:!important;
--x12: !important;
--x13: !important;
--x21:;
--x22: ;
--x23: ;
--x31:x!important;
--x32:x !important;
--x33:x !important;
}