Skip to content

Conversation

@Yue-plus
Copy link

@Yue-plus Yue-plus commented Nov 22, 2025

Fixed 123 SVG ICONS that might have color confusion when used on the same component

@canaleal
Copy link
Member

This is really good, but it will require additional reviewers. It might also mess up the build process.

@canaleal canaleal added the awaiting triage Awaiting triage from a maintainer label Dec 22, 2025
@weh
Copy link
Contributor

weh commented Jan 9, 2026

I like the idea of using the filename for ID and other references. But in the current version of the PR the icons would get converted back to multi-line with no newline at the end. Also it looks like some icons are incorrect, like angular:

image

it looks like the file is missing the closing </radialGradient> tag.

Another one in bootstrap:
image

i did not check all icons.

- Updated angular-original-wordmark.svg to use simplified IDs and removed unnecessary attributes.
- Cleaned up the structure of angular-original.svg for consistency and readability.
@Yue-plus
Copy link
Author

image

Oh, we can't use VScode compressed SVG function, which will modify the id attribute, causing the id attribute of each SVG file to be the same, which will reproduce the problem of #2608

@Yue-plus
Copy link
Author

I like the idea of using the filename for ID and other references. But in the current version of the PR the icons would get converted back to multi-line with no newline at the end. Also it looks like some icons are incorrect, like angular:

image it looks like the file is missing the closing `` tag.

Another one in bootstrap: image

i did not check all icons.

I'm pretty sure the tag not being closed is a false positive from GitHub Diff, I opened the file in VScode and there were no syntax errors, and the image displayed correctly:

image

I'm looking for a way to properly remove newlines and extra spaces from a file...

@Yue-plus
Copy link
Author

@weh Now I have compressed the contents of these 123 SVG files into one line, and I checked each file. There are no syntax errors and they can be displayed correctly.

I used this script to check and modify the file:

# powershell
# Run in the target folder: Set-Location 'c:\code\devicon'
Get-ChildItem -Path . -Recurse -Filter *.svg | ForEach-Object {
    $path = $_.FullName
    $text = Get-Content -Raw -Path $path
    # Replace newlines and tabs with spaces, merge consecutive spaces into 1 space, and remove spaces between labels
    $text = $text -replace '\r?\n|\t', ' '
    $text = $text -replace '\s{2,}', ' '
    $text = $text -replace '>\s+<', '><'
    # Save (preserve UTF8)
    Set-Content -Path $path -Value $text -Encoding UTF8
}

In addition, I noticed that not all SVG files are compressed. Here I show that a total of 1758 files have been modified:

image

I can open a new PR request to submit changes if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting triage Awaiting triage from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants