by dvh · 1mo ago · 0 comments
Imagine being able to declare a list of paths with fill/stroke-paints to draw, filled in from attributes, variables and `calc()` values... one can only dream.
What I really want is something along the lines of...
@declare-some-shape MYSHAPE (ARGS) {
/* tree of draw commands */
/* can reference css animations, timelines, variables, etc. */
}
#my-div { content: draw-some-shape(MYSHAPE ARGS, TRANSFORM); }
/* or, as some kind of pseudo-element: */
#my-div::draw-some-shape(MYSHAPE) { ??? }
And yeah, fully aware that this looks abominable, but I'd rather this than stringly/DOMly generating SVGs or drawing in a canvas.What you described is the CSS painting api (part of CSS Houdini)