From 6f7752c20f605dda102992a984d111cdcd19c57b Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Wed, 5 May 2021 12:53:32 +0200 Subject: Add svg package and a few helpers (#67) Introducing SVG, to inline vector graphics in your HTML! 🥳--- svg/elements.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 svg/elements.go (limited to 'svg/elements.go') diff --git a/svg/elements.go b/svg/elements.go new file mode 100644 index 0000000..98db644 --- /dev/null +++ b/svg/elements.go @@ -0,0 +1,15 @@ +// Package svg provides common SVG elements and attributes. +// See https://developer.mozilla.org/en-US/docs/Web/SVG/Element for an overview. +package svg + +import ( + g "github.com/maragudk/gomponents" +) + +func Path(children ...g.Node) g.Node { + return g.El("path", children...) +} + +func SVG(children ...g.Node) g.Node { + return g.El("svg", g.Attr("xmlns", "http://www.w3.org/2000/svg"), g.Group(children)) +} -- cgit 1.4.1