Skip to content

Commit 434a2ac

Browse files
committed
feat: Migrate from PicoCSS to TailwindCSS + daisyUI
1 parent dd0f325 commit 434a2ac

27 files changed

Lines changed: 507 additions & 254 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,7 @@ jobs:
7878
with:
7979
go-version-file: go.mod
8080
check-latest: true
81+
- name: Setup Bun
82+
uses: oven-sh/setup-bun@v2.2.0
8183
- name: Build
8284
run: make build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
bin
22
tmp
33
node_modules
4-
internal/web/static/css/
4+
internal/web/static/css/*
5+
!internal/web/static/css/input.css
56
internal/web/static/js/
67

78
.DS_Store

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ get-js-deps:
3333
@mkdir -p internal/web/static/js internal/web/static/css
3434
@cp node_modules/htmx.org/dist/htmx.min.js internal/web/static/js/
3535
@cp node_modules/htmx-ext-response-targets/dist/response-targets.min.js internal/web/static/js/
36-
@cp node_modules/@picocss/pico/css/pico.min.css internal/web/static/css/
36+
@bunx tailwindcss -i internal/web/static/css/input.css -o internal/web/static/css/style.css --minify
3737
@cp -r node_modules/ionicons/dist/ionicons internal/web/static/js/
3838

3939
# -------------------------------------------------------------------------------------------------

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# go-templ-htmx-picocss-example
1+
# go-templ-gorm-htmx-tailwindcss-example
22

3-
Example of a Web CRUD app based on [Go](https://github.com/golang/go) + ([sqlite](https://gitlab.com/cznic/sqlite) + [gorm](https://github.com/go-gorm/gorm)) + [templ](https://github.com/a-h/templ) + [</>htmx](https://github.com/bigskysoftware/htmx) + [PicoCSS](https://github.com/picocss/pico) + [Ionicons](https://github.com/ionic-team/ionicons)
3+
Example of a Web CRUD app based on [Go](https://github.com/golang/go) + ([sqlite](https://gitlab.com/cznic/sqlite) + [gorm](https://github.com/go-gorm/gorm)) + [templ](https://github.com/a-h/templ) + [</>htmx](https://github.com/bigskysoftware/htmx) + [tailwindcss](https://github.com/tailwindlabs/tailwindcss) + [DaisyUI](https://daisyui.com) + [Ionicons](https://github.com/ionic-team/ionicons)
44

55

66
![demo](demo.gif)

bun.lock

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

cmd/app/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package main
22

33
import (
4-
"github.com/sonjek/go-templ-htmx-picocss-example/internal/service"
5-
"github.com/sonjek/go-templ-htmx-picocss-example/internal/storage"
6-
"github.com/sonjek/go-templ-htmx-picocss-example/internal/web"
7-
"github.com/sonjek/go-templ-htmx-picocss-example/internal/web/handlers"
4+
"github.com/sonjek/go-templ-gorm-htmx-tailwindcss-example/internal/service"
5+
"github.com/sonjek/go-templ-gorm-htmx-tailwindcss-example/internal/storage"
6+
"github.com/sonjek/go-templ-gorm-htmx-tailwindcss-example/internal/web"
7+
"github.com/sonjek/go-templ-gorm-htmx-tailwindcss-example/internal/web/handlers"
88
)
99

1010
func main() {

demo.gif

-1.81 MB
Binary file not shown.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/sonjek/go-templ-htmx-picocss-example
1+
module github.com/sonjek/go-templ-gorm-htmx-tailwindcss-example
22

33
go 1.26.1
44

internal/service/notes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package service
22

33
import (
4-
database "github.com/sonjek/go-templ-htmx-picocss-example/internal/storage"
4+
database "github.com/sonjek/go-templ-gorm-htmx-tailwindcss-example/internal/storage"
55
"gorm.io/gorm"
66
)
77

internal/storage/note.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ var NotesSeed = []Note{
2222
Body: "Package sqlite is a CGo-free port of SQLite/SQLite3.",
2323
CreatedAt: time.Date(2017, 4, 20, 23, 17, 29, 0, time.UTC),
2424
},
25+
{
26+
Title: "Tailwind CSS",
27+
Body: "A utility-first CSS framework for rapid UI development.",
28+
CreatedAt: time.Date(2017, 11, 1, 21, 11, 0, 0, time.UTC),
29+
},
2530
{
2631
Title: "GoLang",
2732
Body: "The Go programming language.",
@@ -42,6 +47,11 @@ var NotesSeed = []Note{
4247
Body: "</> htmx - high power tools for HTML.",
4348
CreatedAt: time.Date(2022, 8, 10, 21, 21, 0, 0, time.UTC),
4449
},
50+
{
51+
Title: "daisyUI",
52+
Body: "The most popular, free and open-source Tailwind CSS component library.",
53+
CreatedAt: time.Date(2023, 11, 13, 12, 49, 0, 0, time.UTC),
54+
},
4555
}
4656

4757
type Note struct {

0 commit comments

Comments
 (0)