bedrocss icon indicating copy to clipboard operation
bedrocss copied to clipboard

overwrite svg styles

Open nuxodin opened this issue 4 years ago • 2 comments

Here you overwrite svg styles that can be relevant.

https://github.com/AustinGil/bedrocss/blob/e4ee7c65a014d67878e6e45675bbe8c192a89d5a/src/media.css#L10-L12

Note that css is stronger than the svg attributes. Even :where(svg) is stronger.

<svg fill="red">...</svg>

Possible, but maybe a little too much overhead:

svg:not([fill]) { fill:currentColor; } svg:not([stroke]) { stroke:currentColor; } svg:not([stroke-width]) { stroke-width: 0 }

Close this issue if it still fits your use-cases.

nuxodin avatar Jul 08 '21 21:07 nuxodin

Yeah, this is a really good point. Any time I've used an SVG, the fill/stroke colors have always been on the paths themselves, never on the SVG tag. Most of the icon libraries I've used that rely on SVG use the same styles. But that's not to say that you are wrong, you're absolutely right.

So this is a tough one because on one hand, I think these styles are super helpful for most cases. But in the event someone does want to use attributes on the SVG element, this would be annoying...

I may just close this for now and see if anyone reports this issue from using the library. Yeah?

AustinGil avatar Jul 08 '21 22:07 AustinGil

👍

nuxodin avatar Jul 08 '21 22:07 nuxodin