npm / css-select
css-select
What changed in css-select 2 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
19 breaking3 deprecations7 new APIs and options2 behavior and defaults1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initcss-select 710 changes
Breaking changes 8
The deprecated aliases re-export was removed.
The deprecated _compileToken export was removed; use _compileUnsafe instead.
The :enabled pseudo-class now only matches form elements.
The deprecated filters re-export was removed.
The minimum supported Node.js version is now 20.19.0.
The ./package.json subpath export was removed.
The deprecated pseudos re-export was removed; use the pseudos option instead.
The package now sets "type": "module"; CommonJS require() is only supported in modern environments.
New APIs and options 2
The :lang() pseudo-class is now supported.
The nth-* pseudo-classes now support the of clause, such as :nth-last-child(3n+2 of .a).
css-select 59 changes
Breaking changes 3
Deep imports are no longer permitted.
Using :host-context now throws an error.
domhandler's node types have changed, and some of these changes are inherited by css-select.
Deprecations 3
Extending aliases is now deprecated.
Extending filters is now deprecated.
Extending pseudos is now deprecated.
New APIs and options 2
css-select is now distributed as both CJS and ESM.
A pseudos option lets users specify pseudo-classes.
Behavior and default changes 1
The error message for unknown pseudo classes has changed.
css-select 46 changes
Breaking changes 4
Several built-in pseudos are stricter and align with the CSS spec, which might change selector results.
The
!=selector no longer ignores elements without the attribute.In HTML, attributes are now automatically considered case-insensitive, so some selectors might match more elements.
The out-of-date
strictoption was removed.
New APIs and options 2
Attribute selectors now support the s flag.
Pseudo selectors can now be written as aliases that shorten longer selectors.
css-select 27 changes
Breaking changes 4
Fixes exponential time querying; requires a modern JS environment.
Faulty selectors now throw regular errors instead of syntax errors.
The exponential time querying fix requires a modern JS environment.
Pseudo selectors now take the adapter as the second argument and arguments as the third.
New APIs and options 1
Users can pass a DOM adapter in options.
Behavior and default changes 1
Filters are no longer checked for whether they have the required number of arguments.
Fixes and other changes 1
Scope support is improved.