-
Fabien asked the following question:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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:
Let's look at <ellipse cx="75" cy="75" rx="20" ry="5"/> To do the same in Pug, just convert the syntax: ellipse(cx=75 cy=75 rx=20 ry=5) |
Beta Was this translation helpful? Give feedback.
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:To do the same in Pug, just convert the syntax: