diff options
author | Hans Raaf | 2020-10-23 12:32:47 +0200 |
---|---|---|
committer | GitHub | 2020-10-23 12:32:47 +0200 |
commit | c99025e6c569827aa5ca8fb3e16545f1b5f821f2 (patch) | |
tree | f7f639149823354287af497cacbe660a65626154 | |
parent | 3198b25445ce1dc81158353b3e012e8881014790 (diff) | |
download | gomponents-c99025e6c569827aa5ca8fb3e16545f1b5f821f2.tar.lz gomponents-c99025e6c569827aa5ca8fb3e16545f1b5f821f2.tar.zst gomponents-c99025e6c569827aa5ca8fb3e16545f1b5f821f2.zip |
Remove "fmt" import in readme example (#31)
Also style menu in simple example slightly.
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | examples/simple/simple.go | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/README.md b/README.md index d00ebb8..6fe9ca8 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,6 @@ Then do something like this: package main import ( - "fmt" "net/http" g "github.com/maragudk/gomponents" diff --git a/examples/simple/simple.go b/examples/simple/simple.go index adc9094..92bc8cc 100644 --- a/examples/simple/simple.go +++ b/examples/simple/simple.go @@ -36,7 +36,11 @@ func page(props pageProps) g.Node { g.Attr("lang", "en"), el.Head( el.Title(props.title), - el.Style(g.Attr("type", "text/css"), g.Raw(".is-active{font-weight: bold}")), + el.Style(g.Attr("type", "text/css"), + g.Raw(".is-active{font-weight: bold}"), + g.Raw("ul.nav { list-style-type: none; margin: 0; padding: 0; overflow: hidden; }"), + g.Raw("ul.nav li { display: block; padding: 8px; float: left; }"), + ), ), el.Body( navbar(navbarProps{path: props.path}), @@ -66,5 +70,5 @@ func navbar(props navbarProps) g.Node { lis = append(lis, el.Li( el.A(item.path, attr.Classes(map[string]bool{"is-active": props.path == item.path}), g.Text(item.text)))) } - return el.Ul(lis...) + return el.Ul(append(lis, attr.Class("nav"))...) } |