DEV Community

Discussion on: A better way to use SVGs

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited

Or, you know, just use <object>, which works great too :D

(or <use> inside an <svg> tag)

Collapse
 
rafibomb profile image
Rafi

Object works, but does not allow direct CSS styles to be applied.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Nope. <object> works kind of like putting <svg> in a Shadow-DOM so outside CSS won't affect the inside, but inheritance should still work so you should be able to pass information in through custom properties.