Pseudo classes in @starting-style lead to incorrect results #24

Closed
opened 2026-02-16 15:36:52 +01:00 by SirPepe · 2 comments
SirPepe commented 2026-02-16 15:36:52 +01:00 (Migrated from github.com)

Input:

@starting-style {
  dialog:open {
    color: red;
  }
}

Result:

StyleSheet(AtRule(AtKeyword,Block("{",Declaration(PropertyName,":",ValueName,BracedValue("{",ValueName,":",ValueName,";","}")),"}")))

Without ":open" the result makes more sense:

@starting-style {
  dialog {
    color: red;
  }
}

Result:

StyleSheet(AtRule(AtKeyword,Block("{",RuleSet(TagSelector(TagName),Block("{",Declaration(PropertyName,":",ValueName),";","}")),"}")))
Input: ```css @starting-style { dialog:open { color: red; } } ``` Result: ``` StyleSheet(AtRule(AtKeyword,Block("{",Declaration(PropertyName,":",ValueName,BracedValue("{",ValueName,":",ValueName,";","}")),"}"))) ``` Without ":open" the result makes more sense: ```css @starting-style { dialog { color: red; } } ``` Result: ``` StyleSheet(AtRule(AtKeyword,Block("{",RuleSet(TagSelector(TagName),Block("{",Declaration(PropertyName,":",ValueName),";","}")),"}"))) ```
marijnh commented 2026-02-16 15:44:56 +01:00 (Migrated from github.com)

Indeed, seems both parses were valid and getting the same score, causing the parser to pick the wrong one. Attached patch should help.

Indeed, seems both parses were valid and getting the same score, causing the parser to pick the wrong one. Attached patch should help.
SirPepe commented 2026-02-16 15:46:16 +01:00 (Migrated from github.com)

Great, thank you. No more issues incoming from my side 🙃

Great, thank you. No more issues incoming from my side 🙃
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/css#24
No description provided.