NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3515 most downloaded on npm
Style elements relative to other elements in CSS
Last release 2 months ago
22 Jul 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 35 of 35 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
35 releases · first in 2018
Rewritten browser polyfill as ES3
July 22, 2026
Updated: Support for Node 20.19.0 or later (major).
January 14, 2026
20.19.0 or later (major).commonjs API. In supported Node versions require(esm) will work without needing to make code changes.@csstools/selector-specificity to 6.0.0 (major)One column per quarter.
Fix order of removal of CSSOM rules when a browser supports :has() natively
August 27, 2025
:has() nativelyFix handling of stylesheets loaded after the polyfill was first started.
December 13, 2024
Updated: postcss-selector-parser
October 23, 2024
postcss-selector-parser@csstools/selector-specificity to 5.0.0 (major)Updated: Support for Node v18+ (major).
August 3, 2024
@csstools/selector-specificity to 4.0.0 (major)Updated `@csstools/selector-specificity` to `3.1.1` (patch)
May 13, 2024
@csstools/selector-specificity to 3.1.1 (patch)Updated `@csstools/selector-specificity` to `3.1.0` (minor)
May 11, 2024
@csstools/selector-specificity to 3.1.0 (minor)Updated `@csstools/selector-specificity` to `3.0.3` (patch)
March 31, 2024
@csstools/selector-specificity to 3.0.3 (patch)Updated `@csstools/selector-specificity` to `3.0.2` (patch)
February 19, 2024
@csstools/selector-specificity to 3.0.2 (patch)Updated `@csstools/selector-specificity` to `3.0.1` (patch)
December 15, 2023
@csstools/selector-specificity to 3.0.1 (patch)Change license to MIT-0 (read more about this change in the blog post)
July 3, 2023
MIT-0 (read more about this change in the blog post)@csstools/selector-specificity to 3.0.0 (major)Reduce the amount of duplicate fallback CSS.
February 6, 2023
Improve types declaration in package.json
January 28, 2023
types declaration in package.jsonUpdated: Support for Node v14+ (major).
January 24, 2023
:has() unforgiving. :has(.foo, :some-invalid-selector) will no longer match elements that have children with .foo.Fix: correctly cleanup style rules when a browser has native support. backported
December 12, 2022
Fix: assign global browser polyfill to window, self or a blank object.
August 23, 2022
window, self or a blank object.Added: 'hover' options for browser polyfill
July 8, 2022
@supports selector(:has(something)) won't be transformed.- <script src="https://unpkg.com/css-has-pseudo/browser"></script>
+ <script src="https://unpkg.com/css-has-pseudo/dist/browser-global.js"></script>
- <script src="https://unpkg.com/css-has-pseudo/browser.min"></script>
+ <script src="https://unpkg.com/css-has-pseudo/dist/browser-global.js"></script>
_February 5, 2022_ - Rebuild of browser polyfills
February 5, 2022
Fix compatibility with PostCSS v8.2.x #147
January 12, 2022
v8.2.x #147This version is not officially supported but some tool providers pinned PostCSS to v8.2.x,
making it impossible for end users to have a working setup.
Removed Sourcemaps from package tarball.
January 2, 2022
Fixed: require/import paths for browser script
December 27, 2021
_The old CND url is now deprecated and will be removed in a next major release._ _It will continue to work for now._
December 13, 2021
Migrating to 3.0.0
PostCSS plugin :
- const postcssHasPseudo = require('css-has-pseudo/postcss');
+ const postcssHasPseudo = require('css-has-pseudo');
Browser Polyfill :
- const cssHasPseudo = require('css-has-pseudo');
+ const cssHasPseudo = require('css-has-pseudo/browser');
The old CND url is now deprecated and will be removed in a next major release. It will continue to work for now.
- <script src="https://unpkg.com/css-has-pseudo/browser"></script>
+ <script src="https://unpkg.com/css-has-pseudo/dist/browser-global.js"></script>
Updated: Support for PostCS 8+ (major).
September 16, 2021
Updated: postcss-selector-parser to 6.0.2 (major)
June 10, 2019
postcss-selector-parser to 6.0.2 (major)postcss to 7.0.16 (patch)Fixed an issue where inaccessible rules would crash the library
December 11, 2018
_November 26, 2018_ - Improved CLI usage
November 26, 2018
Fixed an issue where attribute names were not being properly encoded
November 26, 2018
Replaced setImmediate with requestAnimationFrame for future compatibility
November 25, 2018
setImmediate with requestAnimationFrame for future compatibilityFixed an issue where nested rules were not supported
November 25, 2018
Further optimize script; from 775 bytes to 757 bytes
November 21, 2018
Fixed an issue with the browser script not picking up added nodes
November 21, 2018
Fixed the misnamed function name for the browser-ready script
November 21, 2018
Improved browser compatibility with updated parsers, encoders, and decoders
November 21, 2018
_November 20, 2018_ - Initial version
November 20, 2018
Your coding agent can read these notes before it upgrades. Set up the MCP server →