Commit d2daf59
authored
This PR improves colors with alpha values where the alpha value results
in 100%.
Before this change, a class like `bg-red-500/100` would be generated as:
```css
.bg-red-500\/100 {
background-color: #ef4444;
}
@supports (color: color-mix(in lab, red, red)) {
.bg-red-500\/100 {
background-color: color-mix(in oklab, var(--color-red-500) 100%, transparent);
}
}
```
But we don't need the `color-mix`, or the fallback styles at all in case
the alpha value is 100%.
After this change the `bg-red-500/100` class will generate as:
```css
.bg-red-500\/100 {
background-color: var(--color-red-500);
}
```
Which is essentially the same as `bg-red-500`, but we can migrate that
away in the future. At least the generated CSS is smaller.
## Test plan
1. Added a test to ensure the generated value doesn't include color-mix
at all.
1 parent 3a1b27e commit d2daf59
3 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10695 | 10695 | | |
10696 | 10696 | | |
10697 | 10697 | | |
| 10698 | + | |
| 10699 | + | |
10698 | 10700 | | |
10699 | 10701 | | |
10700 | 10702 | | |
| |||
10992 | 10994 | | |
10993 | 10995 | | |
10994 | 10996 | | |
| 10997 | + | |
| 10998 | + | |
| 10999 | + | |
| 11000 | + | |
10995 | 11001 | | |
10996 | 11002 | | |
10997 | 11003 | | |
| |||
11012 | 11018 | | |
11013 | 11019 | | |
11014 | 11020 | | |
| 11021 | + | |
| 11022 | + | |
| 11023 | + | |
| 11024 | + | |
11015 | 11025 | | |
11016 | 11026 | | |
11017 | 11027 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
| |||
0 commit comments