Skip to content

Conversation

@bsweeney
Copy link
Member

@bsweeney bsweeney commented Jan 1, 2026

A Rule can return a RuleValueList or a string depending on the CSS property being parsed. A format handler must be supplied when rendering the RuleValueList.

A Rule can return a RuleValueList or a string depending on the CSS property being parsed. A format handler must be supplied when rendering the RuleValueList.
@bsweeney bsweeney requested a review from Copilot January 1, 2026 23:13
@bsweeney bsweeney added this to the 1.0.2 milestone Jan 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves CSS Rule value handling in the Style class by differentiating between RuleValueList objects (which require an OutputFormat parameter for rendering) and string values (which can be cast directly). The change prevents errors when processing different CSS property types.

Key Changes:

  • Introduces an OutputFormat instance for rendering CSS values
  • Adds type checking to handle both Value instances and strings appropriately
  • Applies the fix to both class selector and tag selector processing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bsweeney bsweeney changed the title Vary Rule value handling based on type Vary style Rule value handling based on type Jan 2, 2026
@bsweeney bsweeney merged commit 8259ffb into master Jan 2, 2026
25 checks passed
@bsweeney bsweeney deleted the css-parser-update branch January 2, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants