Skip to content

Commit dd221bc

Browse files
add inverted-colors variant
Co-authored-by: Luke Warlow <[email protected]>
1 parent cc8c069 commit dd221bc

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
@@ -2424,5 +2424,12 @@ exports[`getVariants 1`] = `
24242424
"selectors": [Function],
24252425
"values": [],
24262426
},
2427+
{
2428+
"hasDash": true,
2429+
"isArbitrary": false,
2430+
"name": "inverted-colors",
2431+
"selectors": [Function],
2432+
"values": [],
2433+
},
24272434
]
24282435
`;

packages/tailwindcss/src/variants.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,16 @@ test('forced-colors', () => {
15461546
`)
15471547
})
15481548

1549+
test('inverted-colors', () => {
1550+
expect(run(['inverted-colors:flex'])).toMatchInlineSnapshot(`
1551+
"@media (inverted-colors: inverted) {
1552+
.inverted-colors\\:flex {
1553+
display: flex;
1554+
}
1555+
}"
1556+
`)
1557+
})
1558+
15491559
test('container queries', () => {
15501560
expect(
15511561
compileCss(

packages/tailwindcss/src/variants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -701,5 +701,7 @@ export function createVariants(theme: Theme): Variants {
701701

702702
staticVariant('forced-colors', ['@media (forced-colors: active)'], { compounds: false })
703703

704+
staticVariant('inverted-colors', ['@media (inverted-colors: inverted)'], { compounds: false })
705+
704706
return variants
705707
}

0 commit comments

Comments
 (0)