Skip to content

Conversation

viralcodex
Copy link
Contributor

@viralcodex viralcodex commented Sep 21, 2025

Closes: #2043

  • Added isTransparent utility to detect transparent and zero-alpha color values for fill and stroke attributes.
  • Updated removeUselessStrokeAndFill plugin to treat rgba and hsla with 0 alpha and 'transparent' as 'none', improving SVG cleanup.
  • New tests to verify correct removal of elements with transparent or zero fill/stroke.

Hi @SethFalco and team,

I initially thought of adding the code changes with removeHiddenElems, but it was getting tricky with the previous checks and to integrate with them, the checks for the transparency and color alpha 0.
I felt it would be better to have the enhancements in the removeUselessStrokeAndFill, which already handled most of it from what I understood (can be wrong ofc).

Can be reviewed and let me know if any changes are needed or we can do it in some other way also.

Let me know what u think.

Thanks and have a great day!

- Added isTransparent utility to detect transparent and zero-alpha color values for fill and stroke attributes.
- Updated removeUselessStrokeAndFill plugin to treat these values as 'none', improving SVG cleanup.
- New tests to verify correct removal of elements with transparent or zero fill/stroke.
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.

Feature Request: Add Option to Remove Invisible Items

1 participant