Socket
Book a DemoInstallSign in
Socket

tailwindcss-labeled-groups

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-labeled-groups

A Tailwind plugin that allows you to create multiple groups allowing you to nest them

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Tailwind Labeled Groups

A plugin that allows to create multiple groups utilities such as group-card or group-1 and works with Tailwind 3 features and all variations.

Installation

Install the plugin:

# npm
npm install -D tailwindcss-labeled-groups
# yarn
yarn add -D tailwindcss-labeled-groups

Then add the plugin to your tailwind.config.js file:

module.exports = {
  theme: {
    // ...
  },
  plugins: [
    // This plugin allows you to create custom Tailwind groups.
    // e.g. if you use ['custom'], you could use it as follows:
    //      In the parent: group-custom
    //      In the child:  group-custom-hover:
    require('tailwindcss-labeled-groups')(['custom', '1', /* RENAME ME! */ ])
    // ...
  ],
}

Remember to rename your custom groups!

You are ready to use it

Usage

Assuming we have registered the plugin as follows

require('tailwindcss-labeled-groups')(['custom', '1'])

We now can use:

  • group (default Tailwind value)
  • group-custom and group-1 (registered in the plugin) with every possible combination of variation
<div class="group-custom">
    <div class="group-1">
        <div class="group-1-active:text-slate-500"></div>
    </div>
    <div class="group-custom-focus:bg-pink-200"></div>
</div>

Demo

You can see how it works here: https://play.tailwindcss.com/SMCKXsGYsg

Acknowledgement

Inspired by: tailwindcss-named-groups

FAQs

Package last updated on 10 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts