TailwindCSS plugin that adds support for :empty
pseudo class
Using npm
:
npm i tailwindcss-empty-pseudo-class
Using yarn
:
yarn add tailwindcss-empty-pseudo-class
module.exports = {
// ...
variants: {
display: ['responsive', 'empty']
},
plugins: [
require('tailwindcss-empty-pseudo-class')()
]
// ...
}
<!-- This element will be visible -->
<div class="empty:hidden">Content</div>
<!-- This element will be hidden -->
<div class="empty:hidden"></div>