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

SvgLoaderSelectElement properties doesn't override SVG default CSS #13

Open
olavblj opened this issue Mar 16, 2021 · 1 comment
Open

Comments

@olavblj
Copy link

olavblj commented Mar 16, 2021

My SVG file has this style:

    <style type="text/css">
        <![CDATA[
        path {
            stroke: #222222;
            fill: #444444;
        }
    ]]>
    </style>

When I use the SvgLoaderSelectElement with a selector and set fill or stroke, this is ignored because the style mentioned above apparently overrides it. It works with other props such as visibility, since they are not set globally in the SVG.

If you disagree that this is the way it should behave, are there any hacks I can apply to get it how I want?

@nufaylr
Copy link
Owner

nufaylr commented Mar 27, 2021

Under the hood, SvgLoaderSelectElement is using react-svgmt's SvgProxy component to select and apply the inline style. Maybe you can move the path style into inline style as props or import as style ?

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

2 participants