mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
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:
parent
adc8dfb1a2
commit
191c544c67
@ -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`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user