Skip to content

Conversation

@TtTRz
Copy link
Member

@TtTRz TtTRz commented Dec 29, 2025

No description provided.

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 pull request fixes the gradient position parser to properly handle CSS gradient position syntax including 1-value, 2-value, and 4-value position formats. The changes add support for position offsets relative to specific edges (e.g., left 20px bottom 10%).

Key Changes

  • Added GradientSpecifiedPos enum to represent edge-relative position offsets (left/right/top/bottom with values)
  • Extended GradientPosition enum with a new SpecifiedPos variant
  • Completely refactored gradient_position_repr parser function to handle position-one, position-two, and position-four syntax patterns
  • Added Display implementation for the new SpecifiedPos variant
  • Added comprehensive test coverage for all position syntax variations

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
float-pigment-css/src/typing.rs Adds GradientSpecifiedPos enum and updates GradientPosition enum with SpecifiedPos variant to support edge-relative positioning
float-pigment-css/src/typing_stringify.rs Implements Display formatting for GradientPosition::SpecifiedPos variant
float-pigment-css/src/parser/property_value/gradient.rs Major refactor of gradient position parser with new GradientPositionKeyword enum and restructured parsing logic for position-one/two/four patterns; adds parse_at_ident helper
float-pigment-css/tests/property.rs Adds extensive test cases covering all position syntax variations including edge cases for validation

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

@TtTRz TtTRz force-pushed the fix-gradient-parse branch from a5cd082 to c2884f6 Compare December 30, 2025 09:32
@TtTRz TtTRz merged commit 43960e8 into master Dec 30, 2025
1 check passed
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