Skip to content

Commit e30b9bc

Browse files
lukewarlowphilipp-spiess
authored andcommittedFeb 26, 2025
Add details-content variant
This matches the new `::details-content` pseudo element.
1 parent ab9df29 commit e30b9bc

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
 

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

+7
Original file line numberDiff line numberDiff line change
@@ -8610,6 +8610,13 @@ exports[`getVariants 1`] = `
86108610
"selectors": [Function],
86118611
"values": [],
86128612
},
8613+
{
8614+
"hasDash": true,
8615+
"isArbitrary": false,
8616+
"name": "details-content",
8617+
"selectors": [Function],
8618+
"values": [],
8619+
},
86138620
{
86148621
"hasDash": true,
86158622
"isArbitrary": false,

‎packages/tailwindcss/src/variants.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ test('backdrop', async () => {
9595
expect(await run(['backdrop/foo:flex'])).toEqual('')
9696
})
9797

98+
test('details-content', async () => {
99+
expect(await run(['details-content:flex'])).toMatchInlineSnapshot(`
100+
".details-content\\:flex::details-content {
101+
display: flex;
102+
}"
103+
`)
104+
expect(await run(['details-content/foo:flex'])).toEqual('')
105+
})
106+
98107
test('before', async () => {
99108
expect(await run(['before:flex'])).toMatchInlineSnapshot(`
100109
".before\\:flex:before {
@@ -2092,6 +2101,7 @@ test('variant order', async () => {
20922101
'data-custom:flex',
20932102
'data-[custom=true]:flex',
20942103
'default:flex',
2104+
'details-content:flex',
20952105
'disabled:flex',
20962106
'empty:flex',
20972107
'enabled:flex',
@@ -2178,6 +2188,10 @@ test('variant order', async () => {
21782188
display: flex;
21792189
}
21802190
2191+
.details-content\\:flex::details-content {
2192+
display: flex;
2193+
}
2194+
21812195
.before\\:flex:before, .after\\:flex:after {
21822196
content: var(--tw-content);
21832197
display: flex;

‎packages/tailwindcss/src/variants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ export function createVariants(theme: Theme): Variants {
628628
staticVariant('file', ['&::file-selector-button'])
629629
staticVariant('placeholder', ['&::placeholder'])
630630
staticVariant('backdrop', ['&::backdrop'])
631+
staticVariant('details-content', ['&::details-content'])
631632

632633
{
633634
function contentProperties() {

0 commit comments

Comments
 (0)
Please sign in to comment.