diff options
author | Josep Jesus Bigorra Algaba | 2021-09-07 12:09:57 +0200 |
---|---|---|
committer | GitHub | 2021-09-07 12:09:57 +0200 |
commit | 33524d683661bf73fd224a76ec62fb88b2b3c767 (patch) | |
tree | 74d512ef310dd1a08ac3238267bc23f1d69b4115 /html/attributes.go | |
parent | bd722def2798c8a5a53d0fa87755efefd146198d (diff) | |
download | gomponents-33524d683661bf73fd224a76ec62fb88b2b3c767.tar.lz gomponents-33524d683661bf73fd224a76ec62fb88b2b3c767.tar.zst gomponents-33524d683661bf73fd224a76ec62fb88b2b3c767.zip |
Add loading and srcset HTML attributes (#86)
Useful for `img` and `picture` elements. Fixes #85. Co-authored-by: Josep Jesus Bigorra Algaba <josep@prowarehouse.nl>
Diffstat (limited to 'html/attributes.go')
-rw-r--r-- | html/attributes.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go index b670b05..5a3dc3a 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -126,6 +126,10 @@ func Lang(v string) g.Node { return g.Attr("lang", v) } +func Loading(v string) g.Node { + return g.Attr("loading", v) +} + func Max(v string) g.Node { return g.Attr("max", v) } @@ -182,6 +186,10 @@ func Src(v string) g.Node { return g.Attr("src", v) } +func SrcSet(v string) g.Node { + return g.Attr("srcset", v) +} + func StyleAttr(v string) g.Node { return g.Attr("style", v) } |