Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add classes to icon paths. #6

Open
sykloid opened this issue Oct 16, 2024 · 0 comments
Open

Add classes to icon paths. #6

sykloid opened this issue Oct 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@sykloid
Copy link

sykloid commented Oct 16, 2024

I'd like to use these icons in draw.io, and I've been following this guide to be able to change the color of the icons in the diagram. However, this requires that the path elements in the icon SVGs have classes attached to them. This stackoverflow post explains how to edit the SVGs to make them amenable for color editing.

While I can add these manually, it would be nice if they could be there by default.

Essentially the following changes are necessary (taking zero.svg as an example):

Current:

<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.875 7.75A2.375 2.375 0 0 0 9.5 10.125v3.75a2.375 2.375 0 1 0 4.75 0v-3.75a2.375 2.375 0 0 0-2.375-2.375M8 10.125a3.875 3.875 0 0 1 7.75 0v3.75a3.875 3.875 0 0 1-7.75 0z"/></svg>

With classes:

<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
    .primary{fill:#000000;} 
 </style>
<path class="primary" d="M11.875 7.75A2.375 2.375 0 0 0 9.5 10.125v3.75a2.375 2.375 0 1 0 4.75 0v-3.75a2.375 2.375 0 0 0-2.375-2.375M8 10.125a3.875 3.875 0 0 1 7.75 0v3.75a3.875 3.875 0 0 1-7.75 0z"/></svg>

Notably, the new <style> tag, and the addition of class=primary to the path.

Would this be possible?

Thanks!

@sykloid sykloid added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants