svg-loader icon indicating copy to clipboard operation
svg-loader copied to clipboard

Id scoping issue

Open MarkusRodler opened this issue 8 months ago • 0 comments

To prevent conflicts between conflicting identifiers of different SVGs, svg-loader scopes the identifiers and styling rules by adding prefixes. Thanks for the library. I tried it but it doesn't work the way it is described.

My goal is to load some SVGs that contain several symbols. All symbols have at least a "icon" id and the other symbols have different ones. Think of a arrow SVG and the symbols are: icon, left, right, up and down. If I specify it like that:

<svg><svg data-src="/EyeCon.svg#icon"></svg><use href="#icon"></use></svg>
<svg><svg data-src="/iCon.svg#icon"></svg><use href="#icon"></use></svg>

They will be loading the first symbol with that icon id. It would be nice if the svg-loader adds predictable prefixes like: EyeCon-icon so that this code works as it should be.

MarkusRodler avatar Jun 17 '24 12:06 MarkusRodler