/tailwindcss-only-child

Adds the only-child pseudo-class variant to Tailwindcss

Primary LanguageJavaScript

Tailwindcss only-child

Adds the only-child pseudo-class variant to Tailwindcss

Installation

npm install tailwindcss-only-child

// tailwind.config.js

module.exports = {
    variants: {
        height: ['responsive', 'only'],
    },
    plugins: [
        require('tailwindcss-only-child'),
    ],
};

Usage

<div>
    <div class="only:h-full">
        Take the full height when it is the only child
    </div>
</div>

Author

Maxim Vanhove Web developer at Starring Jane

Twitter Follow