npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

stylelint-plugin-isolate-on-stack

v0.7.0

Published

A Stylelint plugin to detect redundant or invalid uses of 'isolation: isolate' in CSS.

Readme

stylelint-plugin-isolate-on-stack

NPM version Build Status

A Stylelint plugin that detects and prevents stacking context-related issues. This plugin enforces best practices for z-index usage and stacking context generation, aiming to improve CSS quality.

Overview

This plugin is designed for the following purposes:

  • Detect redundant or invalid uses of isolation: isolate
  • Enforce best practices for stacking context generation
  • Help understand how CSS declarations affect stacking contexts

Stacking Context Detection

This plugin automatically detects conditions where CSS properties generate stacking contexts:

  • position: relative/absolute/fixed/sticky + z-index other than auto
  • opacity less than 1
  • transform other than none
  • filter other than none
  • backdrop-filter other than none
  • mix-blend-mode other than normal
  • isolation: isolate
  • contain: layout/paint/strict/content
  • perspective other than none
  • clip-path other than none
  • mask / mask-image / mask-border other than none
  • will-change with properties that generate stacking contexts

When these properties are detected, the plugin identifies redundant isolation: isolate declarations and encourages appropriate corrections.

Installation

Install with the following command:

npm install --save-dev stylelint-plugin-isolate-on-stack

Usage

Configuration

Add the following to your .stylelintrc.json file:

{
  "plugins": ["stylelint-plugin-isolate-on-stack"],
  "rules": {
    // Enable stacking context related rules
    "stylelint-plugin-isolate-on-stack/no-redundant-declaration": true,
    // Detect invalid combinations with background blend modes
    "stylelint-plugin-isolate-on-stack/ineffective-on-background-blend": true,
  },
}

Rules

no-redundant-declaration

Detects redundant isolation: isolate declarations when stacking contexts are already created by other properties.

Incorrect example:

.redundant {
  position: relative;
  z-index: 1;
  isolation: isolate; /* Redundant: position + z-index already creates a stacking context */
}

Correct example:

.not-redundant {
  isolation: isolate; /* OK: No other properties are creating a stacking context */
}

ineffective-on-background-blend

Detects invalid combinations of background-blend-mode and isolation: isolate. isolation: isolate does not affect the behavior of background-blend-mode.

Incorrect example:

.invalid {
  background-blend-mode: multiply;
  isolation: isolate; /* Invalid: does not affect background-blend-mode */
}

Correct example:

.valid {
  isolation: isolate;
  mix-blend-mode: multiply; /* OK: mix-blend-mode is affected by isolation */
}