Skip to content

Commit 6d74187

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

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7592,6 +7592,7 @@ exports[`getVariants 1`] = `
75927592
"dark",
75937593
"print",
75947594
"forced-colors",
7595+
"inverted-colors",
75957596
],
75967597
},
75977598
{
@@ -8282,5 +8283,12 @@ exports[`getVariants 1`] = `
82828283
"selectors": [Function],
82838284
"values": [],
82848285
},
8286+
{
8287+
"hasDash": true,
8288+
"isArbitrary": false,
8289+
"name": "inverted-colors",
8290+
"selectors": [Function],
8291+
"values": [],
8292+
},
82858293
]
82868294
`;

packages/tailwindcss/src/variants.test.ts

Lines changed: 10 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)