Skip to content

Commit 24f1ee5

Browse files
committed
add failing test
1 parent ae8fb14 commit 24f1ee5

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

packages/tailwindcss/src/index.test.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,53 @@ describe('Parsing themes values from CSS', () => {
12081208
`)
12091209
})
12101210

1211+
test('`@theme` values can be unset (using the escaped syntax)', async () => {
1212+
expect(
1213+
await compileCss(
1214+
css`
1215+
@theme {
1216+
--color-red: #f00;
1217+
--color-blue: #00f;
1218+
--text-sm: 13px;
1219+
--text-md: 16px;
1220+
1221+
--animate-spin: spin 1s infinite linear;
1222+
1223+
@keyframes spin {
1224+
to {
1225+
transform: rotate(360deg);
1226+
}
1227+
}
1228+
}
1229+
@theme {
1230+
--color-\*: initial;
1231+
--text-md: initial;
1232+
--animate-\*: initial;
1233+
--keyframes-\*: initial;
1234+
}
1235+
@theme {
1236+
--color-green: #0f0;
1237+
}
1238+
@tailwind utilities;
1239+
`,
1240+
['accent-red', 'accent-blue', 'accent-green', 'text-sm', 'text-md'],
1241+
),
1242+
).toMatchInlineSnapshot(`
1243+
":root {
1244+
--text-sm: 13px;
1245+
--color-green: #0f0;
1246+
}
1247+
1248+
.text-sm {
1249+
font-size: var(--text-sm);
1250+
}
1251+
1252+
.accent-green {
1253+
accent-color: var(--color-green);
1254+
}"
1255+
`)
1256+
})
1257+
12111258
test('all `@theme` values can be unset at once', async () => {
12121259
expect(
12131260
await compileCss(

0 commit comments

Comments
 (0)