HISE Logo Forum
    • Categories
    • Register
    • Login

    Can we draw Path in CSS ?

    Scheduled Pinned Locked Moved General Questions
    cssscriptingstylesvgicon
    4 Posts 3 Posters 133 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • oskarshO
      oskarsh
      last edited by

      I have the feeling I've seen it somewhere. But.

      Is it possible to draw a svg or path in the new CSS renderer?

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @oskarsh
        last edited by

        @oskarsh yes, store it as a base64 string and then use it as background-image property. This is demonstrated here:

        Link Preview Image
        HISE | UI Components | Slider

        The knob / slider element can be used to set values with dragging.

        favicon

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

        1 Reply Last reply Reply Quote 1
        • T
          tonni
          last edited by

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

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @tonni
            last edited by

            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.

            1 Reply Last reply Reply Quote 3
            • First post
              Last post

            19

            Online

            1.8k

            Users

            12.0k

            Topics

            104.8k

            Posts