Skip to content

Commit

Permalink
Add details-content variant
Browse files Browse the repository at this point in the history
This matches the new `::details-content` pseudo element.
  • Loading branch information
lukewarlow committed Dec 6, 2024
1 parent 1238d07 commit 461d88b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7742,6 +7742,13 @@ exports[`getVariants 1`] = `
"selectors": [Function],
"values": [],
},
{
"hasDash": true,
"isArbitrary": false,
"name": "details-content",
"selectors": [Function],
"values": [],
},
{
"hasDash": true,
"isArbitrary": false,
Expand Down
14 changes: 14 additions & 0 deletions packages/tailwindcss/src/variants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ test('backdrop', async () => {
expect(await run(['backdrop/foo:flex'])).toEqual('')
})

test('details-content', async () => {
expect(await run(['details-content:flex'])).toMatchInlineSnapshot(`
".details-content\\:flex::details-content {
display: flex;
}"
`)
expect(await run(['details-content/foo:flex'])).toEqual('')
})

test('before', async () => {
expect(await run(['before:flex'])).toMatchInlineSnapshot(`
".before\\:flex:before {
Expand Down Expand Up @@ -2099,6 +2108,7 @@ test('variant order', async () => {
'data-custom:flex',
'data-[custom=true]:flex',
'default:flex',
'details-content:flex',
'disabled:flex',
'empty:flex',
'enabled:flex',
Expand Down Expand Up @@ -2185,6 +2195,10 @@ test('variant order', async () => {
display: flex;
}
.details-content\\:flex::details-content {
display: flex;
}
.before\\:flex:before, .after\\:flex:after {
content: var(--tw-content);
display: flex;
Expand Down
1 change: 1 addition & 0 deletions packages/tailwindcss/src/variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ export function createVariants(theme: Theme): Variants {
staticVariant('file', ['&::file-selector-button'])
staticVariant('placeholder', ['&::placeholder'])
staticVariant('backdrop', ['&::backdrop'])
staticVariant('details-content', ['&::details-content'])

{
function contentProperties() {
Expand Down

0 comments on commit 461d88b

Please sign in to comment.