Skip to content

Commit

Permalink
add inverted-colors variant
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Warlow <luke@warlow.dev>
  • Loading branch information
RobinMalfait and lukewarlow committed Apr 17, 2024
1 parent cc8c069 commit dd221bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Expand Up @@ -2424,5 +2424,12 @@ exports[`getVariants 1`] = `
"selectors": [Function],
"values": [],
},
{
"hasDash": true,
"isArbitrary": false,
"name": "inverted-colors",
"selectors": [Function],
"values": [],
},
]
`;
10 changes: 10 additions & 0 deletions packages/tailwindcss/src/variants.test.ts
Expand Up @@ -1546,6 +1546,16 @@ test('forced-colors', () => {
`)
})

test('inverted-colors', () => {
expect(run(['inverted-colors:flex'])).toMatchInlineSnapshot(`
"@media (inverted-colors: inverted) {
.inverted-colors\\:flex {
display: flex;
}
}"
`)
})

test('container queries', () => {
expect(
compileCss(
Expand Down
2 changes: 2 additions & 0 deletions packages/tailwindcss/src/variants.ts
Expand Up @@ -701,5 +701,7 @@ export function createVariants(theme: Theme): Variants {

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

staticVariant('inverted-colors', ['@media (inverted-colors: inverted)'], { compounds: false })

return variants
}

0 comments on commit dd221bc

Please sign in to comment.