Skip to content
Discussion options

You must be logged in to vote

All SVG functions are available in Pug. Pug is just a higher-level syntax that allows for custom functions and more readable markup, but at the end of the day, it gets converted into SVG XML and supports all of its features.

My recommended place to learn about SVG is this comprehensive tutorial from Mozilla: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorials/SVG_from_scratch

On the page Basic Shapes, it contains examples of all of the following shapes:

  • rect
  • circle
  • ellipse
  • line
  • polyline
  • polygon
  • path

Let's look at ellipse. To write it in SVG, you would use the following XML syntax:

<ellipse cx="75" cy="75" rx="20" ry="5"/>

To do the same in Pug, just convert the syntax:

ellipse(cx=75

Replies: 1 comment

Comment options

sffc
Jun 26, 2025
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by sffc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant