Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix icons/logos with static SVG IDs to use generated IDs (#5204)
* Remove unnecessary ID from stopSlash icon * [scripts setup] Add check for static SVG IDs - DRY out toString() to one var - switch from indexOf to the slightly more readable `.includes()` API * Set up htmlIdGenerator util for SVGs with IDs - Use different template with htmlIdGenerator import/setup + non-implicit return - tweak template literal indenting - DRY out fileName for use as generator prefix * Replace the static SVG id attributes with dynamic JSX NOTE: I'm avoiding doing this in the `ast` process for two main reasons: 1. I'm a monster who think regexes are neat 2. the ${jsx} in the ast template is an actual tree of components and it seems much more tedious to iterate through each one & examine its attributes (of which the url() attr can have multiple - e.g. fill or mask), rather than use a basic regex capture group * Clean up ID prefixes - in their current state, all icons (except for dropwizard) will automatically truncate their ID names to 'a', 'b', etc. when cleanupIDs is set to true * Run yarn compile-icons moment of truth! * Update snapshots * Add changelog entry
- Loading branch information