JSPM

tailwindcss-focus-visible-within

1.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q18954F
  • License Unlicense

Simplifies targeting parent nodes with a child that has `:focus-visible` using TailwindCSS

Package Exports

  • tailwindcss-focus-visible-within
  • tailwindcss-focus-visible-within/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tailwindcss-focus-visible-within) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tailwindcss-focus-visible-within

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

Installation

Install as dev-dependency using:

npm i -D tailwindcss-focus-visible-within

Tailwind CSS v4

Add the plugin to your style sheet:

@plugin "tailwindcss-focus-visible-within";

Tailwind CSS v3

Add the plugin to your tailwind.config.js:

module.exports = {
  theme: {
    // …
  },
  plugins: [
    require("tailwindcss-focus-visible-within")
    // …
  ],
}

Usage

You can apply Tailwind CSS classes to a parent node that has an element child with the focus-visible state.

<div class="focus-visible-within:…">

Demo

Tailwind Play

<div class="p-3 relative rounded-lg focus-visible-within:outline focus-visible-within:outline-2 focus-visible-within:outline-blue-600">
  <a href="#" class="font-semibold focus-visible:outline-none">
    Link title
    <span class="absolute inset-0"></span>
  </a>
  <p class="text-neutral-600">Link description</p>
</div>