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

Commit 21a7d51

Browse files
authored
Added support for Tailwind CSS v4 (#7)
2 parents 95acbc4 + 20f9c70 commit 21a7d51

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22

33
This plugin allows you to target parent nodes with a child that has `:focus-visible`.
44

5-
## Usage
5+
## Installation
66

77
Install as dev-dependency using:
88

99
```sh
1010
npm i -D tailwindcss-focus-visible-within
1111
```
12+
13+
### Tailwind CSS v4
14+
15+
Add the plugin to your style sheet:
16+
17+
```css
18+
@plugin "tailwindcss-focus-visible-within";
19+
```
20+
21+
### Tailwind CSS v3
22+
1223
Add the plugin to your `tailwind.config.js`:
1324

1425
```js
@@ -17,12 +28,15 @@ module.exports = {
1728
//
1829
},
1930
plugins: [
20-
require('tailwindcss-focus-visible-within')
31+
require("tailwindcss-focus-visible-within")
2132
//
2233
],
2334
}
2435
```
25-
You can now apply Tailwind classes to a parent node that has an element child with the `focus-visible` state.
36+
37+
## Usage
38+
39+
You can apply Tailwind CSS classes to a parent node that has an element child with the `focus-visible` state.
2640

2741
```html
2842
<div class="focus-visible-within:…">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
},
2525
"homepage": "https://github.com/cloudnode-pro/tailwindcss-focus-visible-within#readme",
2626
"peerDependencies": {
27-
"tailwindcss": "^3.4.1"
27+
"tailwindcss": "^3.4.1 || ^4.0.0"
2828
}
2929
}

0 commit comments

Comments
 (0)