CSS theme(): Add unit test that combines CSS variable syntax with opacity modifier (#14323)

This PR adds a new test case to the branches that test the CSS `theme()`
function with the CSS variable syntax. The new case includes an opacity
modifier and ensures that the opacity is properly added.
This commit is contained in:
Philipp Spiess 2024-09-03 18:01:04 +02:00 committed by GitHub
parent adc8dfb1a2
commit 191c544c67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -433,6 +433,28 @@ describe('theme function', () => {
}"
`)
})
test('theme(--color-red-500 / 50%)', async () => {
expect(
await compileCss(css`
@theme {
--color-red-500: #f00;
}
.red {
color: theme(--color-red-500 / 50%);
}
`),
).toMatchInlineSnapshot(`
":root {
--color-red-500: red;
}
.red {
color: #ff000080;
}"
`)
})
test('theme("--color-red-500")', async () => {
expect(
await compileCss(css`