Skip to content

[bug] v1.33.0 rejects valid ::search-text:current and ::search-text:not(:current) selectors #1303

Description

@rvitaliy

Description

Lightning CSS 1.33.0 rejects these valid selectors:

::search-text:current
::search-text:not(:current)

Both are required by the Web Platform Tests for ::search-text and were
accepted by Lightning CSS 1.32.0. The regression affects both lightningcss
and lightningcss-wasm.

Reproduction

npm install lightningcss@1.33.0
import { transform } from "lightningcss";

for (const selector of [
  "::search-text:current",
  "::search-text:not(:current)",
]) {
  transform({
    filename: "input.css",
    code: Buffer.from(`${selector} { color: red }`),
    minify: true,
  });
}

Both calls fail with:

Invalid pseudo class after pseudo element, only user action pseudo classes (e.g. :hover, :active) are allowed

Expected result

Both selectors should be accepted and minified.

Support for ::search-text was added in #1213, but its tests do not cover
these two forms.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions