feat(tools): add SVG to React/CSS utility#65
feat(tools): add SVG to React/CSS utility#65omkarhole wants to merge 2 commits intobetterbugs:developfrom
Conversation
|
Please rebase your PR branch onto the latest develop (do not merge develop into your feature branch). Try: Resolve conflicts and run local checks (npm run lint, npm run build) Notes: Also raise the PR against develop branch and not main @omkarhole |
Add SVG converter tool that transforms raw SVG code into optimized variants: - React Component: Clean, reusable functional component with dynamic sizing - CSS Data URI: Inline SVG for CSS background images - CSS Mask: SVG as CSS mask-image for flexible icon styling Features: - Automatic metadata cleanup (removes XML declarations, comments, DOCTYPE) - viewBox preservation for responsive sizing - Optional currentColor replacement for theme support - Configurable default width/height - File upload support (.svg files) - Copy-to-clipboard functionality
3744dd1 to
d92e9e8
Compare
|
@SyedFahad7 done. please review it |
SyedFahad7
left a comment
There was a problem hiding this comment.
Hey, great work on this @omkarhole, the tool idea and integration are solid, and it's good to see lint/build passing. Just a few blockers to address before we can merge:
-
Preserve
idattributes in React output (svgConverter.tsx) -removing them breaks SVGs that depend onurl(#id)references internally. -
CSS Mask mode should always emit
mask-image/-webkit-mask-image(svgConverter.tsx) — right now it's gated behinduseCurrentColor, which can result in invalid/unusable CSS being output. -
JSX normalization for SVG attributes (
svgConverter.tsx) — attributes likefill-rule,clip-rule, andclassneed to be converted to their JSX equivalents (e.g.fillRule,clipRule,className), otherwise the output generates invalid JSX/TSX.
Once these three are resolved, I'll jump back in for a re-review right away. Thanks again for the contribution!
|
@SyedFahad7 i have made changes as per mentioned . |
Add SVG converter tool that transforms raw SVG code into optimized variants:
Features:
video:
https://github.com/user-attachments/assets/1ae4ede8-404a-44a0-b6a3-c61821d3d083
@rishima17 plz review it
closes: #50