feat(style): add support for custom gradient fills#625
feat(style): add support for custom gradient fills#625charles4221 wants to merge 2 commits intomainfrom
Conversation
3a33ec9 to
c83bfe6
Compare
There was a problem hiding this comment.
Pull request overview
Adds first-class support for custom fill values (including url(#...) gradient references) in the React FontAwesome icon rendering pipeline, and introduces convenience props to generate inline SVG gradient definitions.
Changes:
- Adds
linearGradientandradialGradientprops toFontAwesomeIconProps. - Updates the SVG abstract-element converter to (a) strip built-in
fillattributes from child paths when an overriding fill/gradient is provided and (b) optionally inject gradient elements + applyfill="url(#id)"at the<svg>level.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/types/icon-props.ts | Defines new gradient prop types and inline docs for consumers. |
| src/converter.ts | Implements fill-override behavior and gradient element injection during abstract-to-React conversion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
526763a to
56d0442
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
56d0442 to
d14cdc5
Compare
a9496f3 to
3434d60
Compare
|
@robmadole this is now ready, would love to get your eyes over it when you get a sec! |
Closes #368
Summary
fillprop by ensuring it is applied to the svg element while also removing any built-infillprops from nestedpathelements so the svg fill takes precedencelinearGradientandradialGradientto allow easy application of gradients to icons without providing customfilland creating the gradient elements yourself elsewhere in the DOMResult