Closed dsmatter closed 11 years ago
Defining colors via CSS doesn't go along with chart (SVG) download because CSS rules which apply to parents of the SVG element can't be reflected in the stripped out SVG file.
Example:
CSS:
.line { stroke: red; } .chart[data-type="minmax"] .line { stroke: green }
HTML:
<div class="chart" data-type="minmax"> <svg> <line class="line" /> </svg> </div>
The line will be drawn green in the website but red if we strip out the SVG element and append the stylesheet.
Solved the issue by propagating data-* attributes down to the SVG element.
Defining colors via CSS doesn't go along with chart (SVG) download because CSS rules which apply to parents of the SVG element can't be reflected in the stripped out SVG file.
Example:
CSS:
HTML:
The line will be drawn green in the website but red if we strip out the SVG element and append the stylesheet.