Can we draw Path in CSS ?
-
I have the feeling I've seen it somewhere. But.
Is it possible to draw a svg or path in the new CSS renderer?
-
@oskarsh yes, store it as a base64 string and then use it as
background-image
property. This is demonstrated here:HISE | UI Components | Slider
The knob / slider element can be used to set values with dragging.
(docs.hise.dev)
(scroll down to the next code example).
You can of course hardcode the base64 path directly into CSS if it's not dynamic so for static icons I would prefer this.
-
@oskarsh said in Can we draw Path in CSS ?:
I have the feeling I've seen it somewhere. But.
Is it possible to draw a svg or path in the new CSS renderer?
Yes, it’s possible to work with SVG or paths in the new CSS renderer, but it depends on what exactly you’re trying to do. If you mean using SVG elements like inside your HTML, then yes, they still work just fine and you can style them with CSS as usual. If you're trying to draw shapes purely with CSS, like using clip-path or mask, then the new CSS features do offer more options now. It’s not the same as full SVG drawing, but for many simple shapes and effects, it can do the job. Let us know more about what you’re trying to achieve and we can give better advice.
-
Let us know more about what you’re trying to achieve and we can give better advice.
Damn, bots are getting better but this gave it away.