christian-reichart / svg-chameleon

Easily modify stroke-widths and colors of your SVGs via CSS!
18 stars 4 forks source link

Should custom var come before or after generic var? #9

Closed christian-reichart closed 3 years ago

christian-reichart commented 4 years ago

If you setup custom vars, the order is as follows:

var(--my-custom-color, var(--svg-custom-color, #000))

I guess it would make more sense to order it like this:

var(--svg-custom-color, var(--my-custom-color, #000))

Why? The custom vars are generally used for theming, so they are often applied to multiple if not all icons. The generic variables (svg-custom-color, svg-custom-color-2, etc.) are scoped to each SVG. If we change the order, a general theme can be set to the whole icon set. However if it is needed, svg-custom-color can still be set to each SVG without having to know the theme-variables.

TheJotob commented 4 years ago

Yes. I agree with you. The SVG Vars are more specific than the Custom Vars. So they should have higher priority.