all repos — gomponents @ a5a7242ae036a2dbd75ec40b8677ffa9b77f3209

HTML components in pure Go

Add stroke-width SVG attribute (#116)

Markus Wüstenberg
commit

a5a7242ae036a2dbd75ec40b8677ffa9b77f3209

parent

b12942fb32082729e862eb53b8c3962534561e83

2 files changed, 11 insertions(+), 6 deletions(-)

changed files
M svg/attributes.gosvg/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) }
M svg/attributes_test.gosvg/attributes_test.go
@@ -11,12 +11,13 @@ )
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 {