ampproject / ampproject/amphtml

CSS Comment breaks validation

Open
#33,514 1 comment 0 reactions 0 assignees View on GitHub
Stale Type: Bug
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## What's the issue?

When a string containing disallowed class prefix is present in a CSS comment it is flagged as a validation error.

## How do we reproduce the issue?

Add a CSS comment within `` containing a disallowed class name, such as:

``` <style amp-custom> /* Can't use .i-amphtml- selectors here */ ```

## What browsers are affected?

All browsers

## Which AMP version is affected?

Probably not a new issue, first identified on a page using AMP version 2103122145004

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by placing a disallowed class prefix in a comment inside , then trace the CSS validation entry point that reports the error. The fix is complete when such comments are ignored while actual disallowed selectors remain flagged, with the relevant validation checks passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
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.