I wonder how often do people write SVG by hand?
If often then it's definietly a good idea to simplify SVG/XML for writing.
I once experimented with some extremely minimal formats[1] built on Jevko[2] (I am its father) particularly aimed at compacting SVG. For example:
svg width[391] height[391] viewBox[-70.5 -70.5 391 391] xmlns[http://www.w3.org/2000/svg] xmlns:xlink[http://www.w3.org/1999/xlink][
rect fill[#fff] stroke[#000] x[-70] y[-70] width[390] height[390]
g opacity[0.8][
rect x[25] y[25] width[200] height[200] fill[lime] stroke-width[4] stroke[pink]
circle cx[125] cy[125] r[75] fill[orange]
polyline points[50,150 50,200 200,200 200,100] stroke[red] stroke-width[4] fill[none]
line x1[50] y1[50] x2[200] y2[200] stroke[blue] stroke-width[4]
]
]
Compared to CSS-like syntax like in the post, the advantage of this is that it is extremely simple and generic, as it works for XML in general (especially the more minimal flavors, e.g. [3]).
There are no specialized features here but also not many parsing challenges or edge cases.Clearly, there are ways to simplify these things, but not many people seem to be really interested in that.