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

tailwind-initial

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

tailwind-initial

Tailwind plugin that generates utilities at a low specificity

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

tailwind-initial

Generates utilities at a low specificity using CSS layers, letting developers set default styles for a component that can be overridden by adding plain Tailwind utility classes.

Usage

npm install tailwind-initial
// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwind-initial'),
    // ...
  ],
}
<h1 class="initial:text-white">Hello, world!</h1><!-- white text -->
<h1 class="initial:text-white text-black">Hello, world!</h1><!-- black text -->

Options

By default, the variant name is initial, and the generated layer name is tw-initial. These names can be customized like so:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwind-initial')({ name: 'init', layer: 'init-layer' }),
    // ...
  ],
}

Should you use it?

Maybe, maybe not! This is an experimental approach, and it might be preferable to configure your utility classes within your components. However, this might come in handy during the initial stages of component design, when the customization requirements are not yet known.

Keywords

FAQs

Package last updated on 25 Jun 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