feat: improve real-time chart example; add small refinements to via core files
This commit is contained in:
@@ -34,6 +34,10 @@ func Class(v string) H {
|
||||
return gh.Class(v)
|
||||
}
|
||||
|
||||
func Role(v string) H {
|
||||
return gh.Role(v)
|
||||
}
|
||||
|
||||
// Data attributes automatically have their name prefixed with "data-".
|
||||
func Data(name, v string) H {
|
||||
return gh.Data(name, v)
|
||||
|
||||
8
h/h.go
8
h/h.go
@@ -11,6 +11,7 @@ package h
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
g "maragu.dev/gomponents"
|
||||
gc "maragu.dev/gomponents/components"
|
||||
)
|
||||
@@ -50,6 +51,13 @@ func Attr(name string, value ...string) H {
|
||||
return g.Attr(name, value...)
|
||||
}
|
||||
|
||||
func If(condition bool, n H) H {
|
||||
if condition {
|
||||
return n
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// HTML5Props defines properties for HTML5 pages. Title is set always set, Description
|
||||
// and Language elements only if the strings are non-empty.
|
||||
type HTML5Props struct {
|
||||
|
||||
Reference in New Issue
Block a user