about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarkus Wüstenberg2022-11-15 14:48:01 +0100
committerGitHub2022-11-15 14:48:01 +0100
commita5a7242ae036a2dbd75ec40b8677ffa9b77f3209 (patch)
treedc3d742939d5dbcf2f45b8491bbdd97e0cb38ce3
parentb12942fb32082729e862eb53b8c3962534561e83 (diff)
downloadgomponents-a5a7242ae036a2dbd75ec40b8677ffa9b77f3209.tar.lz
gomponents-a5a7242ae036a2dbd75ec40b8677ffa9b77f3209.tar.zst
gomponents-a5a7242ae036a2dbd75ec40b8677ffa9b77f3209.zip
Add stroke-width SVG attribute (#116)
-rw-r--r--svg/attributes.go4
-rw-r--r--svg/attributes_test.go13
2 files changed, 11 insertions, 6 deletions
diff --git a/svg/attributes.go b/svg/attributes.go
index 10b7c69..52c9c61 100644
--- a/svg/attributes.go
+++ b/svg/attributes.go
@@ -24,6 +24,10 @@ func Stroke(v string) g.Node {
 	return g.Attr("stroke", v)
 }
 
+func StrokeWidth(v string) g.Node {
+	return g.Attr("stroke-width", v)
+}
+
 func ViewBox(v string) g.Node {
 	return g.Attr("viewBox", v)
 }
diff --git a/svg/attributes_test.go b/svg/attributes_test.go
index c41fb45..7e26548 100644
--- a/svg/attributes_test.go
+++ b/svg/attributes_test.go
@@ -11,12 +11,13 @@ import (
 
 func TestSimpleAttributes(t *testing.T) {
 	cases := map[string]func(string) g.Node{
-		"clip-rule": ClipRule,
-		"d":         D,
-		"fill":      Fill,
-		"fill-rule": FillRule,
-		"stroke":    Stroke,
-		"viewBox":   ViewBox,
+		"clip-rule":    ClipRule,
+		"d":            D,
+		"fill":         Fill,
+		"fill-rule":    FillRule,
+		"stroke":       Stroke,
+		"stroke-width": StrokeWidth,
+		"viewBox":      ViewBox,
 	}
 
 	for name, fn := range cases {