Commit dd1ca3c
Related issue: #19445
## Summary
Fixes an issue where tailwindcss wraps `color-mix` inside a `@supports`
block even if the original code already checks for support.
Uncompiled Code:
```css
@Utility foo {
@supports (color: color-mix(in lab, red, red)) {
background: color-mix(in lab, var(--color-1), var(--color-2));
}
}
```
### Compiled code: Current behavior
https://play.tailwindcss.com/KSvR7wefdh?file=css
```css
@layer utilities {
.foo {
@supports (color: color-mix(in lab, red, red)) {
background: var(--color-1);
@supports (color: color-mix(in lab, red, red)) {
background: color-mix(in lab, var(--color-1), var(--color-2));
}
}
}
```
### Compiled code: Fixed behavior
```css
@layer utilities {
@supports (color: color-mix(in lab, red, red)) {
.foo {
background: color-mix(in lab, var(--color-1), var(--color-2));
}
}
```
## Test plan
I have tested this by writing a new test that was at first failing. Now
it passes.
---------
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
1 parent 73b5df6 commit dd1ca3c
3 files changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| |||
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
| 387 | + | |
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5812 | 5812 | | |
5813 | 5813 | | |
5814 | 5814 | | |
| 5815 | + | |
| 5816 | + | |
| 5817 | + | |
| 5818 | + | |
| 5819 | + | |
| 5820 | + | |
| 5821 | + | |
| 5822 | + | |
| 5823 | + | |
| 5824 | + | |
| 5825 | + | |
| 5826 | + | |
| 5827 | + | |
| 5828 | + | |
| 5829 | + | |
| 5830 | + | |
| 5831 | + | |
| 5832 | + | |
| 5833 | + | |
| 5834 | + | |
| 5835 | + | |
| 5836 | + | |
5815 | 5837 | | |
5816 | 5838 | | |
5817 | 5839 | | |
| |||
0 commit comments