all repos — gomponents @ 6efec2175f61125c3cae694b9a4327a990484ca0

HTML components in pure Go

Add aria-* and role attributes (#59) Fixes #50.

Markus Wüstenberg
commit

6efec2175f61125c3cae694b9a4327a990484ca0

parent

f22ce3fb68ca6702a683b7759410ae50a9fddabd

1 file changed, 9 insertions(+), 0 deletions(-)

changed files
M html/attributes.gohtml/attributes.go
@@ -56,6 +56,11 @@ func Alt(v string) g.Node {
return g.Attr("alt", v) } +// Aria attributes automatically have their name prefixed with "aria-". +func Aria(name, v string) g.Node { + return g.Attr("aria-"+name, v) +} + func AutoComplete(v string) g.Node { return g.Attr("autocomplete", v) }
@@ -138,6 +143,10 @@ }
func Rel(v string) g.Node { return g.Attr("rel", v) +} + +func Role(v string) g.Node { + return g.Attr("role", v) } func Rows(v string) g.Node {