Skip to content

Commit ab9c3df

Browse files
committed
Add details-content variant
This matches the new `::details-content` pseudo element.
1 parent a8c54ac commit ab9c3df

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet
10+
### Added
11+
12+
- Target `::details-content` in new `details-content` variant ([#15319](https://github.com/tailwindlabs/tailwindcss/pull/15319))
1113

1214
## [4.0.0] - 2025-01-21
1315
## [4.0.0-beta.10] - 2025-01-21

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

+7
Original file line numberDiff line numberDiff line change
@@ -7749,6 +7749,13 @@ exports[`getVariants 1`] = `
77497749
"selectors": [Function],
77507750
"values": [],
77517751
},
7752+
{
7753+
"hasDash": true,
7754+
"isArbitrary": false,
7755+
"name": "details-content",
7756+
"selectors": [Function],
7757+
"values": [],
7758+
},
77527759
{
77537760
"hasDash": true,
77547761
"isArbitrary": false,

packages/tailwindcss/src/variants.test.ts

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

107+
test('details-content', async () => {
108+
expect(await run(['details-content:flex'])).toMatchInlineSnapshot(`
109+
".details-content\\:flex::details-content {
110+
display: flex;
111+
}"
112+
`)
113+
expect(await run(['details-content/foo:flex'])).toEqual('')
114+
})
115+
107116
test('before', async () => {
108117
expect(await run(['before:flex'])).toMatchInlineSnapshot(`
109118
".before\\:flex:before {
@@ -2115,6 +2124,7 @@ test('variant order', async () => {
21152124
'data-custom:flex',
21162125
'data-[custom=true]:flex',
21172126
'default:flex',
2127+
'details-content:flex',
21182128
'disabled:flex',
21192129
'empty:flex',
21202130
'enabled:flex',
@@ -2209,6 +2219,10 @@ test('variant order', async () => {
22092219
display: flex;
22102220
}
22112221
2222+
.details-content\\:flex::details-content {
2223+
display: flex;
2224+
}
2225+
22122226
.before\\:flex:before, .after\\:flex:after {
22132227
content: var(--tw-content);
22142228
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)