Remove unnecessary clipPath from Sun icon SVG#56614
Merged
Conversation
1b80a8f to
b616bd2
Compare
zmb3
approved these changes
Jul 9, 2025
kimlisa
approved these changes
Jul 9, 2025
ravicious
approved these changes
Jul 9, 2025
Comment on lines
+13
to
+15
| 3. Ensure that the icon does not contain unnecessary `clipPath` elements (this will be a single 24x24 rect in a | ||
| `clipPath` element). If it does, delete the `g` element (keeping the `path`) that references the `clipPath`, and the | ||
| `defs` element that contains the `clipPath`. This is necessary to ensure that the icon optimizes correctly. |
Member
There was a problem hiding this comment.
We could as well link to this PR for an example I think.
Comment on lines
+13
to
+15
| 3. Ensure that the icon does not contain unnecessary `clipPath` elements (this will be a single 24x24 rect in a | ||
| `clipPath` element). If it does, delete the `g` element (keeping the `path`) that references the `clipPath`, and the | ||
| `defs` element that contains the `clipPath`. This is necessary to ensure that the icon optimizes correctly. |
Member
There was a problem hiding this comment.
Too bad we can't enforce that with a linter, there's react/forbid-elements which could forbid clipPath, but it won't work on the SVGs inside the assets folder since those are just plain SVG files and not React components.
But if someone adds a new icon that has clipPath, the icon won't be visible anyway which hopefully will be enough to catch this. 🤔
Contributor
|
@ryanclark See the table below for backport results.
|
This was referenced Jul 9, 2025
marcoandredinis
pushed a commit
that referenced
this pull request
Jul 10, 2025
* Remove unnecessary clipPath from Sun icon SVG * Fix other icons that use a clipPath too * Add instructions for not including clipPaths in icons * Link icon README to this PR
greedy52
pushed a commit
that referenced
this pull request
Aug 26, 2025
* Remove unnecessary clipPath from Sun icon SVG * Fix other icons that use a clipPath too * Add instructions for not including clipPaths in icons * Link icon README to this PR
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 26, 2025
* Remove unnecessary clipPath from Sun icon SVG * Fix other icons that use a clipPath too * Add instructions for not including clipPaths in icons * Link icon README to this PR Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
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.
The sun icon copies from Figma with a clipPath that isn't necessary for the rendering of the SVG. For some reason, running this through SVGO results in an empty path being created, which blocks out the icon (
<path d="M0 0h24v24H0z" />)The moon icon is fine:
There are two more icons like this,
CameraandModelContextProtocol. I updated those too, and added info to the icon'sREADME.mdabout this process (will post on Slack)changelog: Fix some icons displaying as white/black blocks