Socket
Socket
Sign inDemoInstall

tailwindcss-z-index-map

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-z-index-map

Generate a z-index map with TailwindCSS to easily keep track of your project's z-index usage.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

tailwindcss-z-index-map

tailwindcss-z-index-map is currently only tested with v3 of TailwindCSS.

A plugin for TailwindCSS that grants the ability to configure a set of z-map utility classes that remove the need for magical z-index numbers. Instead, define an array of classes in your Tailwind config in order from smaller z-index to larger.

Installation

Install the plugin from npm.

# Using npm
npm install tailwindcss-z-index-map

# Using yarn
yarn add tailwindcss-z-index-map

Then add the plugin to your tailwind.config.js file. Define your z-index map in the theme object.

// tailwind.config.js
module.exports = {
  theme: {
    zIndexMap: ["lowest-item", "middle-item", "highest-item"],
  },
  plugins: [require("tailwidcss-z-index-map")],
};

This will result in the following utility classes being generated:

.z-map-lowest-item {
  z-index: 1;
}

.z-map-middle-item {
  z-index: 2;
}

.z-map-highest-item {
  z-index: 3;
}

If you were to add another item in the middle of the map in the future, .z-map-highest-item would increase to a z-index of 4.

FAQs

Package last updated on 05 Dec 2021

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