unstale

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 init

@unstale/cli on npm

css-select 710 changes

Breaking changes 8

  • The deprecated aliases re-export was removed.

    7.0.0release notes

  • The deprecated _compileToken export was removed; use _compileUnsafe instead.

    7.0.0release notes

  • The :enabled pseudo-class now only matches form elements.

    7.0.0release notes

  • The deprecated filters re-export was removed.

    7.0.0release notes

  • The minimum supported Node.js version is now 20.19.0.

    7.0.0release notes

  • The ./package.json subpath export was removed.

    7.0.0release notes

  • The deprecated pseudos re-export was removed; use the pseudos option instead.

    7.0.0release notes

  • The package now sets "type": "module"; CommonJS require() is only supported in modern environments.

    7.0.0release notes

New APIs and options 2

  • The :lang() pseudo-class is now supported.

    7.0.0release notes

  • The nth-* pseudo-classes now support the of clause, such as :nth-last-child(3n+2 of .a).

    7.0.0release notes

css-select 59 changes

Breaking changes 3

  • Deep imports are no longer permitted.

    5.0.0release notes

  • Using :host-context now throws an error.

    5.0.0release notes

  • domhandler's node types have changed, and some of these changes are inherited by css-select.

    5.0.0release notes

Deprecations 3

New APIs and options 2

  • css-select is now distributed as both CJS and ESM.

    5.0.0release notes

  • A pseudos option lets users specify pseudo-classes.

    5.0.0release notes

Behavior and default changes 1

  • The error message for unknown pseudo classes has changed.

    5.0.0release notes

css-select 46 changes

Breaking changes 4

  • Several built-in pseudos are stricter and align with the CSS spec, which might change selector results.

    4.0.0release notes

  • The != selector no longer ignores elements without the attribute.

    4.0.0release notes

  • In HTML, attributes are now automatically considered case-insensitive, so some selectors might match more elements.

    4.0.0release notes

  • The out-of-date strict option was removed.

    4.0.0release notes

New APIs and options 2

  • Attribute selectors now support the s flag.

    4.0.0release notes

  • Pseudo selectors can now be written as aliases that shorten longer selectors.

    4.0.0release notes

css-select 27 changes

Breaking changes 4

  • Fixes exponential time querying; requires a modern JS environment.

    2.0.0release notes

  • Faulty selectors now throw regular errors instead of syntax errors.

    2.0.0release notes

  • The exponential time querying fix requires a modern JS environment.

    2.0.0release notes

  • Pseudo selectors now take the adapter as the second argument and arguments as the third.

    2.0.0release notes

New APIs and options 1

Behavior and default changes 1

  • Filters are no longer checked for whether they have the required number of arguments.

    2.0.0release notes

Fixes and other changes 1