svg-loader
svg-loader copied to clipboard
Id scoping issue
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.