prefix the all id attributes with a string, random or customisable
See original GitHub issue🚀 Feature Proposal
Prepend random, set string to each id
, so that they’re unique per this SVG.
Motivation
When you export multiple SVG from let’s say Illustrator, you get same id names, for example #b
, #d
and so on. They tend to clash, so I have to manually go to the output of svgr
and prepend some string to each id
value. Can this be automated somehow?
Example
Can we use maybe nanoid
or let’s say add an input to the GUI sidebar to prepend that string to each id
?
Pitch
Because in real-life, more often than not, there will be multiple SVG’s on a given page, which, in turn, will have to have unique id
s because they’re on the same page.
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to apply the css on all ID starting with [duplicate]
One way to achieve what you are looking for in pure CSS is with an attribute prefix selector (which uses a form of...
Read more >How to Implement a Custom, Sequence-Based ID Generator
A lot of applications use IDs that are based on a sequence but use an additional prefix. You can easily support these IDs...
Read more >String claims transformations - Azure AD B2C - Microsoft Learn
String claims transformation examples for the Identity Experience Framework ... Creates a random string using the random number generator.
Read more >Tools attributes reference | Android Studio
Android Studio supports a variety of XML attributes in the tools ... menu IDs, separated by commas (without @menu/ or any such ID...
Read more >Prisma schema API (Reference)
Name, Required, Type, Description. provider, Yes, String ( postgresql , mysql , sqlite , sqlserver , mongodb , cockroachdb ), Describes which data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AlfieJones That’s a good start but it only updates the ID for
clipPath
. URL references for masks, for example, would not work.This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.