Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Guess what "DOM integration" means.

Does it mean unusably inconvenient? Because that's what I call having to embed SVGs just so CSS works with them.



Hold up. Are you blaming SVG because you don't know the <object> tag exists? I mean, yeah, you're right that CSS won't come through with an <img> tag. It will with <object> though.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ob...



Ah, I misunderstood what you were trying to accomplish. Yes, it makes sense that you have to embed the SVG in your HTML doc. SVG isn't an image format; it's a document format just like HTML is. Embedding the SVG puts it in the same document context as the HTML and therefore the same styling context.

Would you expect a parent's CSS to affect HTML in an iframe, a separate document context? That would be confusing behavior to be sure. Side effects galore.


No I wouldn't, because a) iframes are used to provide isolation, and b) nobody really wants that.

The use case for styling external SVGs with CSS is waaay more obvious. We should at least have the option to do it, even if it isn't enabled by default.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: