Skip to content

Commit 00e1cea

Browse files
committed
Add :popover-open variant
1 parent 0b7f27c commit 00e1cea

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
- Add spacing scale to `min-w-*`, `min-h-*`, and `max-w-*` utilities ([#12300](https://github.com/tailwindlabs/tailwindcss/pull/12300))
3232
- Add `forced-color-adjust` utilities ([#11931](https://github.com/tailwindlabs/tailwindcss/pull/11931))
3333
- Add `forced-colors` variant ([#11694](https://github.com/tailwindlabs/tailwindcss/pull/11694))
34+
- Add `:popover-open` variant ([#12148](https://github.com/tailwindlabs/tailwindcss/pull/12148))
3435
- [Oxide] New Rust template parsing engine ([#10252](https://github.com/tailwindlabs/tailwindcss/pull/10252))
3536
- [Oxide] Support `@import "tailwindcss"` using top-level `index.css` file ([#11205](https://github.com/tailwindlabs/tailwindcss/pull/11205), ([#11260](https://github.com/tailwindlabs/tailwindcss/pull/11260)))
3637
- [Oxide] Use `lightningcss` for nesting and vendor prefixes in PostCSS plugin ([#10399](https://github.com/tailwindlabs/tailwindcss/pull/10399))

src/corePlugins.js

+4
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,10 @@ export let variantPlugins = {
464464
forcedColorsVariants: ({ addVariant }) => {
465465
addVariant('forced-colors', '@media (forced-colors: active)')
466466
},
467+
468+
popoverOpenVariant: ({ addVariant }) => {
469+
addVariant('popover-open', '&:popover-open')
470+
},
467471
}
468472

469473
let cssTransformValue = [

src/lib/setupContextUtils.js

+1
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ function resolvePlugins(context, root) {
762762
variantPlugins['printVariant'],
763763
variantPlugins['screenVariants'],
764764
variantPlugins['orientationVariants'],
765+
variantPlugins['popoverOpenVariant'],
765766
]
766767

767768
return [...corePluginList, ...beforeVariants, ...userPlugins, ...afterVariants, ...layerPlugins]
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)