Skip to content

Commit

Permalink
Add not-focus-visible variant to Tailwind plugin (#2618)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed Jul 27, 2023
1 parent ac859fe commit 685a6a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/@headlessui-tailwindcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ export default plugin.withOptions<Options>(({ prefix = 'ui' } = {}) => {
`&[data-headlessui-state]:not([data-headlessui-state~="${state}"])`,
`:where([data-headlessui-state]:not([data-headlessui-state~="${state}"])) &:not([data-headlessui-state])`,
])

addVariant(`${prefix}-focus-visible`, ':where([data-headlessui-focus-visible]) &:focus')
}

addVariant(`${prefix}-focus-visible`, ':where([data-headlessui-focus-visible]) &:focus')
addVariant(
`${prefix}-not-focus-visible`,
'&:focus:where(:not([data-headlessui-focus-visible] &))'
)
}
})

2 comments on commit 685a6a8

@vercel
Copy link

@vercel vercel bot commented on 685a6a8 Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

headlessui-vue – ./packages/playground-vue

headlessui-vue-git-main-tailwindlabs.vercel.app
headlessui-vue.vercel.app
headlessui-vue-tailwindlabs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 685a6a8 Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

headlessui-react – ./packages/playground-react

headlessui-react-tailwindlabs.vercel.app
headlessui-react.vercel.app
headlessui-react-git-main-tailwindlabs.vercel.app

Please sign in to comment.