Skip to content

Commit c0dd091

Browse files
committed
Add :popover-open variant
1 parent 614c7e2 commit c0dd091

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- Don’t crash when important and parent selectors are equal in `@apply` ([#12112](https://github.com/tailwindlabs/tailwindcss/pull/12112))
2525
- Eliminate irrelevant rules when applying variants ([#12113](https://github.com/tailwindlabs/tailwindcss/pull/12113))
2626
- Improve RegEx parser, reduce possibilities as the key for arbitrary properties ([#12121](https://github.com/tailwindlabs/tailwindcss/pull/12121))
27+
- Add `:popover-open` variant ([#12148](https://github.com/tailwindlabs/tailwindcss/pull/12148))
2728

2829
### Added
2930

src/corePlugins.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ export let variantPlugins = {
460460
addVariant('contrast-more', '@media (prefers-contrast: more)')
461461
addVariant('contrast-less', '@media (prefers-contrast: less)')
462462
},
463+
464+
popoverOpenVariant: ({ addVariant }) => {
465+
addVariant('popover-open', '&:popover-open')
466+
},
463467
}
464468

465469
let cssTransformValue = [

src/lib/setupContextUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ function resolvePlugins(context, root) {
761761
variantPlugins['printVariant'],
762762
variantPlugins['screenVariants'],
763763
variantPlugins['orientationVariants'],
764+
variantPlugins['popoverOpenVariant'],
764765
]
765766

766767
return [...corePluginList, ...beforeVariants, ...userPlugins, ...afterVariants, ...layerPlugins]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { css, quickVariantPluginTest } from '../../util/run'
2+
3+
quickVariantPluginTest('popoverOpenVariant').toMatchFormattedCss(css`
4+
.popover-open\:flex:popover-open {
5+
display: flex;
6+
}
7+
`)

0 commit comments

Comments
 (0)