This is a problem because the cascading effect of CSS means that the styles of one icon can overwrite another.
In the example below I have the 7-Eleven svg followed by the Circle K svg. The green color of 7-Eleven is being overwritten by styles in set in the Circle K svg.
Issue
I noticed that a number of SVG icons have nested
<style>
tags. Search resultsExample of a nested
<style>
:This is a problem because the cascading effect of CSS means that the styles of one icon can overwrite another.
In the example below I have the 7-Eleven svg followed by the Circle K svg. The green color of 7-Eleven is being overwritten by styles in set in the Circle K svg.
Proposed solution
We should have a test that rejects nested
<style>
tags. This is similar to the work @maximevaillancourt did for checking for nested<img>
tags in https://github.com/activemerchant/payment_icons/issues/174Contributors are welcome to inline their styles with
style
orfill
attributes as this doesn't have the cascading effect. Examples of icons usingfill
in the markups.