Skip to content

Commit fdfaa6f

Browse files
committed
add test for @theme static
1 parent d068ef5 commit fdfaa6f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/tailwindcss/src/index.test.ts

+27
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,33 @@ describe('Parsing themes values from CSS', () => {
18071807
`)
18081808
})
18091809

1810+
test('theme values added as `static` will always be generated, regardless of whether they were used or not', async () => {
1811+
expect(
1812+
await compileCss(
1813+
css`
1814+
@theme static {
1815+
--color-tomato: #e10c04;
1816+
--color-potato: #ac855b;
1817+
--color-primary: var(--primary);
1818+
}
1819+
1820+
@tailwind utilities;
1821+
`,
1822+
['bg-tomato'],
1823+
),
1824+
).toMatchInlineSnapshot(`
1825+
":root, :host {
1826+
--color-tomato: #e10c04;
1827+
--color-potato: #ac855b;
1828+
--color-primary: var(--primary);
1829+
}
1830+
1831+
.bg-tomato {
1832+
background-color: var(--color-tomato);
1833+
}"
1834+
`)
1835+
})
1836+
18101837
test('wrapping `@theme` with `@media theme(inline)` behaves like `@theme inline` to support `@import` statements', async () => {
18111838
expect(
18121839
await compileCss(

0 commit comments

Comments
 (0)