Commit c0e8cf4
authored
fix: prevent !important from being renamed in CSS modules (#20798)
* test: add test case reproducing !important rename bug in CSS modules
Adds animation/color declarations with !important to css-modules test
to reproduce the issue where !important gets treated as a local
identifier and renamed (e.g. !my-app-style_module_css-important).
Ref: #20794
* fix: prevent !important from being renamed in CSS modules
Add a delim callback to track exclamation marks during CSS declaration
value parsing, so the subsequent "important" identifier is skipped
instead of being collected as a renameable local identifier.
Fixes #20794
* chore: add changeset for !important CSS modules fix1 parent f8d274b commit c0e8cf4
7 files changed
Lines changed: 97 additions & 0 deletions
File tree
- .changeset
- lib/css
- test/configCases/css
- css-modules
- __snapshots__
- pure-css/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
1772 | 1773 | | |
1773 | 1774 | | |
1774 | 1775 | | |
| 1776 | + | |
| 1777 | + | |
1775 | 1778 | | |
1776 | 1779 | | |
1777 | 1780 | | |
1778 | 1781 | | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
1779 | 1786 | | |
1780 | 1787 | | |
1781 | 1788 | | |
| |||
1824 | 1831 | | |
1825 | 1832 | | |
1826 | 1833 | | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1827 | 1839 | | |
1828 | 1840 | | |
1829 | 1841 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2736 | 2736 | | |
2737 | 2737 | | |
2738 | 2738 | | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2739 | 2745 | | |
2740 | 2746 | | |
2741 | 2747 | | |
| |||
5511 | 5517 | | |
5512 | 5518 | | |
5513 | 5519 | | |
| 5520 | + | |
| 5521 | + | |
| 5522 | + | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
5514 | 5526 | | |
5515 | 5527 | | |
5516 | 5528 | | |
| |||
8200 | 8212 | | |
8201 | 8213 | | |
8202 | 8214 | | |
| 8215 | + | |
| 8216 | + | |
| 8217 | + | |
| 8218 | + | |
| 8219 | + | |
| 8220 | + | |
8203 | 8221 | | |
8204 | 8222 | | |
8205 | 8223 | | |
| |||
10939 | 10957 | | |
10940 | 10958 | | |
10941 | 10959 | | |
| 10960 | + | |
| 10961 | + | |
| 10962 | + | |
| 10963 | + | |
| 10964 | + | |
| 10965 | + | |
10942 | 10966 | | |
10943 | 10967 | | |
10944 | 10968 | | |
| |||
11147 | 11171 | | |
11148 | 11172 | | |
11149 | 11173 | | |
| 11174 | + | |
11150 | 11175 | | |
11151 | 11176 | | |
11152 | 11177 | | |
| |||
13916 | 13941 | | |
13917 | 13942 | | |
13918 | 13943 | | |
| 13944 | + | |
| 13945 | + | |
| 13946 | + | |
| 13947 | + | |
| 13948 | + | |
| 13949 | + | |
13919 | 13950 | | |
13920 | 13951 | | |
13921 | 13952 | | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2736 | 2736 | | |
2737 | 2737 | | |
2738 | 2738 | | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2739 | 2745 | | |
2740 | 2746 | | |
2741 | 2747 | | |
| |||
5511 | 5517 | | |
5512 | 5518 | | |
5513 | 5519 | | |
| 5520 | + | |
| 5521 | + | |
| 5522 | + | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
5514 | 5526 | | |
5515 | 5527 | | |
5516 | 5528 | | |
| |||
8200 | 8212 | | |
8201 | 8213 | | |
8202 | 8214 | | |
| 8215 | + | |
| 8216 | + | |
| 8217 | + | |
| 8218 | + | |
| 8219 | + | |
| 8220 | + | |
8203 | 8221 | | |
8204 | 8222 | | |
8205 | 8223 | | |
| |||
10939 | 10957 | | |
10940 | 10958 | | |
10941 | 10959 | | |
| 10960 | + | |
| 10961 | + | |
| 10962 | + | |
| 10963 | + | |
| 10964 | + | |
| 10965 | + | |
10942 | 10966 | | |
10943 | 10967 | | |
10944 | 10968 | | |
| |||
11147 | 11171 | | |
11148 | 11172 | | |
11149 | 11173 | | |
| 11174 | + | |
11150 | 11175 | | |
11151 | 11176 | | |
11152 | 11177 | | |
| |||
13916 | 13941 | | |
13917 | 13942 | | |
13918 | 13943 | | |
| 13944 | + | |
| 13945 | + | |
| 13946 | + | |
| 13947 | + | |
| 13948 | + | |
| 13949 | + | |
13919 | 13950 | | |
13920 | 13951 | | |
13921 | 13952 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2055 | 2055 | | |
2056 | 2056 | | |
2057 | 2057 | | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
2629 | 2635 | | |
2630 | 2636 | | |
2631 | 2637 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
2629 | 2635 | | |
2630 | 2636 | | |
2631 | 2637 | | |
| |||
0 commit comments