Skip to content

Commit 4485ba2

Browse files
committed
feat: add plugin
1 parent 85b5fb8 commit 4485ba2

26 files changed

+419
-30
lines changed

.gitignore

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
1-
# If you prefer the allow list template instead of the deny list, see community template:
2-
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3-
#
4-
# Binaries for programs and plugins
5-
*.exe
6-
*.exe~
7-
*.dll
8-
*.so
9-
*.dylib
10-
11-
# Test binary, built with `go test -c`
12-
*.test
13-
14-
# Code coverage profiles and other test artifacts
15-
*.out
16-
coverage.*
17-
*.coverprofile
18-
profile.cov
19-
20-
# Dependency directories (remove the comment below to include it)
21-
# vendor/
22-
23-
# Go workspace file
24-
go.work
25-
go.work.sum
26-
27-
# env file
28-
.env
1+
# Via DevMode
2+
.via
293

304
# Editor/IDE
31-
# .idea/
32-
# .vscode/
5+
.idea/
6+
.vscode/
7+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# via-plugin-picocss
22
Enables styles from PicoCSS globally in a Via application.
3+
4+
The PicoCSS plugin integrates seamlessly with Via to provide elegant, responsive, and lightweight styling for your components without writing any CSS manually.
5+
6+
See PicoCSS [Documentation](https://picocss.com/docs), to learn more about PicoCSS.

go.mod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module github.com/go-via/via-plugin-picocss
2+
3+
go 1.25.4
4+
5+
require github.com/go-via/via v0.0.0-20251112033322-d28277337989
6+
7+
require (
8+
github.com/CAFxX/httpcompression v0.0.9 // indirect
9+
github.com/andybalholm/brotli v1.2.0 // indirect
10+
github.com/klauspost/compress v1.18.0 // indirect
11+
github.com/starfederation/datastar-go v1.0.3 // indirect
12+
github.com/valyala/bytebufferpool v1.0.0 // indirect
13+
maragu.dev/gomponents v1.2.0 // indirect
14+
)

go.sum

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
github.com/CAFxX/httpcompression v0.0.9 h1:0ue2X8dOLEpxTm8tt+OdHcgA+gbDge0OqFQWGKSqgrg=
2+
github.com/CAFxX/httpcompression v0.0.9/go.mod h1:XX8oPZA+4IDcfZ0A71Hz0mZsv/YJOgYygkFhizVPilM=
3+
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
4+
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
5+
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
6+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
8+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9+
github.com/go-via/via v0.0.0-20251112033322-d28277337989 h1:RVVxVLFmXuujnBNRYriia0dFnfo9yjN4pOVny6+FVrs=
10+
github.com/go-via/via v0.0.0-20251112033322-d28277337989/go.mod h1:/DIbrdoRZo8xrK2c2p4eO8KPUiTIKSeeRufMGRxc1nY=
11+
github.com/google/brotli/go/cbrotli v0.0.0-20230829110029-ed738e842d2f h1:jopqB+UTSdJGEJT8tEqYyE29zN91fi2827oLET8tl7k=
12+
github.com/google/brotli/go/cbrotli v0.0.0-20230829110029-ed738e842d2f/go.mod h1:nOPhAkwVliJdNTkj3gXpljmWhjc4wCaVqbMJcPKWP4s=
13+
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
14+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
15+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
16+
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
17+
github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=
18+
github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
19+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
20+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
21+
github.com/starfederation/datastar-go v1.0.3 h1:DnzgsJ6tDHDM6y5Nxsk0AGW/m8SyKch2vQg3P1xGTcU=
22+
github.com/starfederation/datastar-go v1.0.3/go.mod h1:stm83LQkhZkwa5GzzdPEN6dLuu8FVwxIv0w1DYkbD3w=
23+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
24+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
25+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
26+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
27+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
28+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
29+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
30+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
31+
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
32+
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
33+
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
34+
github.com/valyala/gozstd v1.20.1 h1:xPnnnvjmaDDitMFfDxmQ4vpx0+3CdTg2o3lALvXTU/g=
35+
github.com/valyala/gozstd v1.20.1/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ=
36+
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
37+
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
38+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
39+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
40+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
41+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
42+
maragu.dev/gomponents v1.2.0 h1:H7/N5htz1GCnhu0HB1GasluWeU2rJZOYztVEyN61iTc=
43+
maragu.dev/gomponents v1.2.0/go.mod h1:oEDahza2gZoXDoDHhw8jBNgH+3UR5ni7Ur648HORydM=

internal/example/main.go

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package main
2+
3+
import (
4+
"github.com/go-via/via"
5+
"github.com/go-via/via-plugin-picocss/picocss"
6+
. "github.com/go-via/via/h"
7+
)
8+
9+
func main() {
10+
11+
v := via.New()
12+
13+
v.Config(via.Options{
14+
DevMode: true,
15+
DocumentTitle: "PicoCSS Plugin for Via",
16+
Plugins: []via.Plugin{
17+
18+
// Plugin is placed here.
19+
// Use picocss.Default to add the plugin with default options.
20+
picocss.WithOptions(picocss.Options{
21+
IncludeColors: true,
22+
}),
23+
},
24+
})
25+
26+
v.Page("/", func(c *via.Context) {
27+
28+
c.View(func() H {
29+
return Main(Class("container"),
30+
Section(
31+
Nav(
32+
Ul(Li(Strong(Text("⚡Via")))),
33+
Ul(
34+
Li(A(Text("About"), Href("https://github.com/go-via/via"))),
35+
Li(A(Text("Resources"), Href("https://github.com/orgs/go-via/repositories"))),
36+
Li(A(Text("Comunity"), Href("http://github.com/go-via/via/discussions"))),
37+
),
38+
),
39+
),
40+
41+
Section(
42+
H1(Text(" PicoCSS Plugin for Via")),
43+
P(Text("Minimal CSS styles for semantic HTML ― Right in your Via app! ✨")),
44+
),
45+
46+
A(Button(Class("outline"), Text("PicoCSS docs")), Href("https://picocss.com/docs"), Style("margin-right:10px")),
47+
A(Button(Text("View on GitHub")), Href("https://github.com/go-via/via-plugin-picocss")),
48+
49+
Section(
50+
Hr(),
51+
H5(Text("About the Plugin")),
52+
P(Text("The PicoCSS plugin integrates seamlessly with Via to provide elegant, responsive, and lightweight styling for your components without writing any CSS manually.")),
53+
54+
Hr(),
55+
H5(Text("Available Themes")),
56+
Div(Class("grid"),
57+
Ul(
58+
Li(Mark(Class("pico-background-amber"), Text("Amber")), Text(" *")),
59+
Li(Mark(Class("pico-background-blue"), Text("Blue"))),
60+
Li(Mark(Class("pico-background-cyan"), Text("Cyan"))),
61+
Li(Mark(Class("pico-background-fuchsia"), Text("Fuchsia"))),
62+
Li(Mark(Class("pico-background-green"), Text("Green"))),
63+
),
64+
Ul(
65+
Li(Mark(Class("pico-background-grey"), Text("Grey"))),
66+
Li(Mark(Class("pico-background-indigo"), Text("Indigo"))),
67+
Li(Mark(Class("pico-background-jade"), Text("Jade"))),
68+
Li(Mark(Class("pico-background-lime"), Text("Lime"))),
69+
Li(Mark(Class("pico-background-orange"), Text("Orange"))),
70+
),
71+
Ul(
72+
Li(Mark(Class("pico-background-pink"), Text("Pink"))),
73+
Li(Mark(Class("pico-background-pumpkin"), Text("Pumpkin"))),
74+
Li(Mark(Class("pico-background-purple"), Text("Purple"))),
75+
Li(Mark(Class("pico-background-red"), Text("Red"))),
76+
Li(Mark(Class("pico-background-sand"), Text("Sand"))),
77+
),
78+
Ul(
79+
80+
Li(Mark(Class("pico-background-slate"), Text("Slate"))),
81+
Li(Mark(Class("pico-background-violet"), Text("Violet"))),
82+
Li(Mark(Class("pico-background-yellow"), Text("Yellow"))),
83+
Li(Mark(Class("pico-background-zinc"), Text("Zinc"))),
84+
),
85+
),
86+
P(Small(Text("* default theme."))),
87+
))
88+
89+
})
90+
})
91+
92+
v.Start()
93+
}

picocss/pico.amber.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

picocss/pico.blue.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

picocss/pico.colors.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

picocss/pico.cyan.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

picocss/pico.fuchsia.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)