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

The module removes "fill" attribute when converting to symbol #67

Open
dko-slapdash opened this issue Oct 2, 2019 · 2 comments
Open

Comments

@dko-slapdash
Copy link

dko-slapdash commented Oct 2, 2019

A bugreport here:

https://github.com/karify/external-svg-sprite-loader/blob/842c04a092665b724a25c9c4ff36b974808a0821/lib/SvgDocument.js#L170

Due to this explicit whitelist of attributes,

<svg width="16" height="16" viewBox="0 0 16 16" fill="none" ...>

becomes

<symbol id="..." viewBox="0 0 16 16">

I.e. fill="none" is removed and thus the image changes.

Maybe we can just copy all attributes (or blacklist some) instead of whitelisting? Because fill may not be the only one attribute...

@beautyfree
Copy link

beautyfree commented Dec 3, 2020

agree with @dko-slapdash
@bensampaio I can't use this package because of "fill" property not listed and become remove.

My icons with "fill" looks like
image

and after plugin work it looks like:
image

@bertms
Copy link

bertms commented Dec 26, 2023

@bensampaio
The SvgDocument.js method does not add the fill attribute, Expect to add it in versions 6.0 and 7.0.
// Create the symbol attributes
['class', 'preserveAspectRatio', 'viewBox'].forEach((name) => {
const value = this.getAttribute(name);

        if (value) {
            attrs.push(`${name}="${value}"`);
        }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants