Skip to content

Commit 5f03afd

Browse files
committed
update release notes
1 parent 6b2ee78 commit 5f03afd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@
5858

5959
This change was contributed by [@yisibl](https://github.com/yisibl).
6060

61+
* Trim CSS rules that will never match
62+
63+
The CSS minifier will now remove rules whose selectors contain `:is()` and `:where()` as those selectors will never match. These selectors can currently be automatically generated by esbuild when you give esbuild nonsensical input such as the following:
64+
65+
```css
66+
/* Original code */
67+
div:before {
68+
color: green;
69+
&.foo {
70+
color: red;
71+
}
72+
}
73+
74+
/* Old output (with --supported:nesting=false --minify) */
75+
div:before{color:green}:is().foo{color:red}
76+
77+
/* New output (with --supported:nesting=false --minify) */
78+
div:before{color:green}
79+
```
80+
81+
This input is nonsensical because CSS nesting is (unfortunately) not supported inside of pseudo-elements such as `:before`. Currently esbuild generates a rule containing `:is()` in this case when you tell esbuild to transform nested CSS into non-nested CSS. I think it's reasonable to do that as it sort of helps explain what's going on (or at least indicates that something is wrong in the output). It shouldn't be present in minified code, however, so this release now strips it out.
82+
6183
## 0.25.11
6284
6385
* Add support for `with { type: 'bytes' }` imports ([#4292](https://github.com/evanw/esbuild/issues/4292))

0 commit comments

Comments
 (0)