tailwindcss-empty

1.0.0 • Public • Published

tailwindcss-empty

Dead simple Tailwind plugin that adds a variant for the :empty CSS pseudo-class.

Installation

npm i tailwindcss-empty

Usage

In your tailwind.js:

  modules: {
    // The plugin only generates classes when you explicitly
    // register the 'empty' state variant for a module
    display: ['responsive', 'empty'],
    // ...
  },
 
  plugins: [
    require('tailwindcss-empty')(),
    // ...
  ]

In your HTML:

<!-- This span will be displayed normally. -->
<span class="errors empty:hidden">Whoops!</span>
 
<!-- This one will be hidden. -->
<span class="errors empty:hidden"></span>

Package Sidebar

Install

npm i tailwindcss-empty

Weekly Downloads

72

Version

1.0.0

License

MIT

Unpacked Size

2.72 kB

Total Files

4

Last publish

Collaborators

  • bakerkretzmar