chrvadala / react-svg-pan-zoom

:eyes: A React component that adds pan and zoom features to SVG
https://chrvadala.github.io/react-svg-pan-zoom/
MIT License
677 stars 125 forks source link

SvgLoaderSelectElement properties doesn't override SVG default CSS #196

Open olavblj opened 3 years ago

olavblj commented 3 years ago

My SVG file has this style:

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

When I use the SvgLoaderSelectElement (from the react-svg-pan-zoom-loader library) 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?