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

> you need to embed it directly.

Guess what “DOM integration” means.

> SVG is so bad people have been using fonts instead

Icon fonts have been out of fashion for so long I almost suspect you time traveled from the past.



> 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.


Just out of curiosity, what has replaced icon fonts?


Graphics (typically vector), GitHub has a good writeup on the why

* font rendering issues

* rendering improvements

* accessibility

* ease of authoring

* can be animated

https://github.blog/2016-02-22-delivering-octicons-with-svg/....

https://speakerdeck.com/ninjanails/death-to-icon-fonts


Font folks also really underestimated how much people like having access to graphics with more than one color.


They didn't: https://fonts.google.com/knowledge/introducing_type/introduc... (is that a good idea for icons, not sure though)


Are you really going to compare a technology like SVG that was supported by IE9 (and lower with a plugin) with one only just supported by the Blink engine May, 2022 in Chrome 101?

For all intents and purposes with regard to web development, fonts have been monochromatic (except for emojis). Any with sufficient knowledge gathered over decades can write/edit an SVG in the editor of their choice, graphical or textual.

How does one edit their own color font? Can you do it in a text editor? Do most font editing programs support it? Or were you speaking of fonts purely as a consumer rather than a producer?




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

Search: