Skip to content

Commit bda1052

Browse files
committed
add inverted-colors variant
1 parent a8c54ac commit bda1052

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap

+7
Original file line numberDiff line numberDiff line change
@@ -8282,5 +8282,12 @@ exports[`getVariants 1`] = `
82828282
"selectors": [Function],
82838283
"values": [],
82848284
},
8285+
{
8286+
"hasDash": true,
8287+
"isArbitrary": false,
8288+
"name": "inverted-colors",
8289+
"selectors": [Function],
8290+
"values": [],
8291+
},
82858292
]
82868293
`;

packages/tailwindcss/src/variants.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,16 @@ test('forced-colors', async () => {
19361936
expect(await run(['forced-colors/foo:flex'])).toEqual('')
19371937
})
19381938

1939+
test('inverted-colors', async () => {
1940+
expect(await run(['inverted-colors:flex'])).toMatchInlineSnapshot(`
1941+
"@media (inverted-colors: inverted) {
1942+
.inverted-colors\\:flex {
1943+
display: flex;
1944+
}
1945+
}"
1946+
`)
1947+
})
1948+
19391949
test('nth', async () => {
19401950
expect(
19411951
await run([

packages/tailwindcss/src/variants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,8 @@ export function createVariants(theme: Theme): Variants {
11341134

11351135
staticVariant('forced-colors', ['@media (forced-colors: active)'])
11361136

1137+
staticVariant('inverted-colors', ['@media (inverted-colors: inverted)'])
1138+
11371139
return variants
11381140
}
11391141

0 commit comments

Comments
 (0)