w3c / w3c/css-validator

Property does not exist error on container queries

Open
#474 0 comments 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 throws false positives for properties relating to container queries.

As an example, I get these errors for the following markup example:

  1. Error: CSS: container-name: Property container-name doesn't exist.
    From line 10, column 25; to line 10, column 38
    ner-name: test-container;↩

  2. Error: CSS: container-type: Property container-type doesn't exist.
    From line 11, column 25; to line 11, column 35
    ner-type: inline-size;↩

  3. Error: CSS: Unrecognized at-rule @container
    From line 16, column 7; to line 16, column 16
    }↩ @container test-

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Test Container Queries</title>
    <style>
      .container {
        container-name: test-container;
        container-type: inline-size;
      }
      p {
        font-size: 1rem;
      }
      @container test-container (max-width: 300px) {
        p {
          font-size: .5rem;
        }
      }
    </style>
  </head>

  <body>
    <div class="container">
      <p>
        Test if this is valid.
      </p>
    </div>
  </body>
</html>

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

No source file or test is named. Reproduce the supplied HTML, then locate the CSS validation rules for container-name, container-type, and @container; done means the example validates without false-positive property or at-rule errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Bug
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.