4

How can I draw this shape using a single svg path?

enter image description here

abhishek khandait
  • 1,577
  • 1
  • 12
  • 17

1 Answers1

5

You can do it with a single path, but currently there's no such thing as variable width stroke. Instead, such a shape can be drawn using fill on a path criss-crossing itself:

#hide-stroke:checked ~ svg path {
  stroke: none;
}

svg {
  display: block;
}
<input id="hide-stroke" type="checkbox" />
<label for="hide-stroke">Hide stroke</label>

<svg xmlns="http://www.w3.org/2000/svg" width="600" height="300" viewBox="0,0 200,100" >
   <path d="M20,80  q26,-100 53,-25  q26,75 53,0  q26,-90 53,0  q-26,-70 -45,-10  q-26,80 -70,0  q-25,-40 -37,0" 
         fill="black" stroke-width="1" stroke="limegreen" />
</svg>
Sphinxxx
  • 11,400
  • 4
  • 49
  • 78