Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit e358b76

Browse files
authored
Add focus-visible-within for group (parent) and peer (sibling) (#2)
2 parents 3d104ed + 2a2b93a commit e358b76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
const plugin = require('tailwindcss/plugin');
1+
const plugin = require("tailwindcss/plugin");
22

33
module.exports = plugin(function ({addVariant}) {
4-
addVariant('focus-visible-within', ['&:has(:focus-visible)'])
4+
addVariant("focus-visible-within", ["&:has(:focus-visible)"]);
5+
addVariant("group-focus-visible-within", ":merge(.group):has(:focus-visible) &");
6+
addVariant("peer-focus-visible-within", ":merge(.peer):has(:focus-visible) ~ &");
57
});

0 commit comments

Comments
 (0)