w3c / w3c/css-validator

Misleading parse error

Open
#520 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
250
Forks
123
PR merge metrics
No merged PRs in 30d

Description

The validator claims a "Parse Error" at the word after in the following (perfectly working) CSS rule:

a[href]:where(
  [href^="https://"],
  [href^="http://"],
):after {
    content: url('open-external-link-icon.svg');
    display: inline-block;
    width:1.2ex;
    margin-left:.3ex;
}

Contributor guide

Open the contributing guide

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

Start by running the supplied CSS rule through the validator and trace how its parser handles :where(...) and the trailing comma before :after. Done means this rule no longer reports a parse error at after, with a regression test covering the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
tooling, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.