Keep leading + glued in An+B notation (#19738)

This commit is contained in:
Lazizbek Ergashev authored and GitHub committed 2026-07-28 11:07:34 +08:00
1 parent 0a1416fd56
commit f426cfafb7
4 files changed
+110 -5

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#### Keep leading `+` glued in An+B notation (#19738 by @lazerg)
The An+B grammar doesn't allow whitespace between a leading `+` and the `n`, so the extra space produced invalid output.
<!-- prettier-ignore -->
```css
/* Input */
a:nth-child(+3n+2) {
}
/* Prettier stable */
a:nth-child(+ 3n + 2) {
}
/* Prettier main */
a:nth-child(+3n + 2) {
}
```