Skip to content

Commit dd430ec

Browse files
lukewarlowphilipp-spiess
authored andcommitted
add inverted-colors variant
1 parent 62d3e74 commit dd430ec

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
@@ -8448,6 +8448,7 @@ exports[`getVariants 1`] = `
84488448
"dark",
84498449
"print",
84508450
"forced-colors",
8451+
"inverted-colors",
84518452
],
84528453
},
84538454
{
@@ -9169,5 +9170,12 @@ exports[`getVariants 1`] = `
91699170
"selectors": [Function],
91709171
"values": [],
91719172
},
9173+
{
9174+
"hasDash": true,
9175+
"isArbitrary": false,
9176+
"name": "inverted-colors",
9177+
"selectors": [Function],
9178+
"values": [],
9179+
},
91729180
]
91739181
`;

packages/tailwindcss/src/variants.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,16 @@ test('forced-colors', async () => {
19071907
expect(await run(['forced-colors/foo:flex'])).toEqual('')
19081908
})
19091909

1910+
test('inverted-colors', async () => {
1911+
expect(await run(['inverted-colors:flex'])).toMatchInlineSnapshot(`
1912+
"@media (inverted-colors: inverted) {
1913+
.inverted-colors\\:flex {
1914+
display: flex;
1915+
}
1916+
}"
1917+
`)
1918+
})
1919+
19101920
test('nth', async () => {
19111921
expect(
19121922
await run([

packages/tailwindcss/src/variants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,8 @@ export function createVariants(theme: Theme): Variants {
11431143

11441144
staticVariant('forced-colors', ['@media (forced-colors: active)'])
11451145

1146+
staticVariant('inverted-colors', ['@media (inverted-colors: inverted)'])
1147+
11461148
return variants
11471149
}
11481150

0 commit comments

Comments
 (0)