Hacker News new | ask | show | jobs
by ChrisSD 3234 days ago
It's amusing that both this and "SVG can do that?"[1] are on the front page right now. Is it better to draw using HTML/CSS or SVG? I guess the answer is complicated.

[1] https://news.ycombinator.com/item?id=15023766

3 comments

From a practical perspective, I've had lots of bad experience with devs insisting on being clever and drawing complex graphics with layers of pseudo elements and complex gradients when dropping in an svg is quicker and more maintainable.
SVG can work very well, an example project is Google Blockly [1].

[1] https://developers.google.com/blockly/

is this the same thing MIT scratch uses?
From the docs [1]:

"Scratch Blocks [2]: Designed by the people behind MIT's Scratch and built on the Blockly code base, Scratch Blocks offers a simplified programming model ideal for young learners."

[1] https://developers.google.com/blockly/guides/overview

[2] https://scratch.mit.edu/developers

In my personal/anecdotal experience, I've noticed a higher performance ceiling using HTML/CSS over SVG. Doing similar operations between the two usually shows SVG with better performance but if you are willing to put in the effort HTML/CSS can be made to outperform SVG.