New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tailwindcss-current

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-current

Add degree values into background gradients

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
increased by135.71%
Maintainers
1
Weekly downloads
 
Created
Source

TailwindCSS Current

Style active (current) state for your page links, selected tabs etc with ease

Why?

Typical situation: you're on /foo page and you want to style active link with different styles

<a href="/" class="bg-gray-100">Home</a>
<a href="/foo" class="active bg-gray-100">I'm active and want to be green...</a>

With this plugin you can do it with current: variant

<a href="/" class="bg-gray-100">Home</a>
<a href="/foo" class="active current:bg-green-500 bg-gray-100">Now I'm green</a>

Installation

npm i tailwindcss-current

Add it in configuration file in plugins section

module.exports = {
    plugins: [
        require('tailwindcss-current'),
    ],
}

By default current state will be applied for every element with .active class but you can specify any selector like

module.exports = {
    plugins: [
        require('tailwindcss-current')('.is-active'),
    ],
}

it could be really any selector - just pass a string

module.exports = {
    plugins: [
        require('tailwindcss-current')('[data-active]'),
    ],
}
<a href="/" class="b    g-gray-100">Home</a>
<a href="/foo" data-active class="current:bg-green-500 bg-gray-100">Now I'm green</a>

Also you may use group-current variant

<ul>
    <li class="bg-gray-100 active current:bg-red-500">
        <a href="/" class="group-current:font-bold">I'm bold and my parent is red</a>
    </li>
    <li class="bg-gray-100 current:bg-red-500">
        <a href="/" class="group-current:font-bold">Normal gray link</a>
    </li>
</ul>

Keywords

FAQs

Package last updated on 29 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc