fb55 / fb55/css-what

[Feature request] Support for forgiving selector parsing

Open
#1,254 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good-first-issue
Dominant language
TypeScript
Stars
250
Forks
49
Avg merge
12m
Merged PRs (30d)
21

Description

Right now, parser will throw even in the case of :is() pseudo-class that contains an invalid selector (even if there are other valid selectors).

That pseudo-class apparent accepts a forgiving selector list: https://developer.mozilla.org/en-US/docs/Web/CSS/:is#forgiving_selector_parsing

For example, in the following case css will still apply to valid selectors

:is(ol, ul, ??$#$@#) {
  color: green;
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by locating the parser entry point for the :is() pseudo-class and the existing selector-list parsing logic. Implement forgiving handling so invalid selectors do not prevent valid selectors from being parsed, then verify the example containing ol, ul, and the invalid selector.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.