Z-Index

Ahmad Awais

Ahmad Awais

Follow on Twitter @MrAhmadAwais

Variants

By default, only responsive, focus-within and focus variants are generated for z-index utilities.

You can control which variants are generated for the z-index utilities by modifying the zIndex property in the variants section of your tailwind.config.js file.

For example, this config will also generate hover and active variants:

// tailwind.config.js
module.exports = { variants: { extend: { // ...
+ zIndex: ['hover', 'active'],
} } }
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
+ zIndex: ['hover', 'active'],
},
},
};
Ahmad Awais

Ahmad Awais

Follow on Twitter @MrAhmadAwais

Want CSS + Tailwind updates?

Sign up for the TwinCSS newsletter to stay up to date.

I don't spam. Pinky promise.
Read the Terms and Privacy Policy.