Conversation
There was a problem hiding this comment.
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
GradientSpecifiedPosenum to represent edge-relative position offsets (left/right/top/bottom with values) - Extended
GradientPositionenum with a newSpecifiedPosvariant - Completely refactored
gradient_position_reprparser function to handle position-one, position-two, and position-four syntax patterns - Added Display implementation for the new
SpecifiedPosvariant - 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.
a5cd082 to
c2884f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.