Skip to content

feat(cli): Add DaisyUI Option & Fix Styles for Consistency #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,25 @@ Read detailed usage and examples of every stack configured.

- [Go + Echo + Templates](/docs/go-echo-templates.md)

# Configuration Options

**Web Framework**
- Echo

**Styling**
- Vanilla CSS
- Tailwind

**UI Library**
- Preline

**Extra Options**
- HTMX
- Dockerfile

# Coming Soon

- More Framework Options.
- Deployments strategies like docker.
- Better templating with [templ](https://templ.guide) and [fiber](https://docs.gofiber.io) (django syntax).
- More examples and documentation.
- Please suggest More 🙏🏼
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var (
}
UILibraryOpts = map[string][]string{
"Preline": {"Tailwind"},
"DaisyUI": {"Tailwind"},
}
)

Expand Down
2 changes: 1 addition & 1 deletion template/base/makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ dev:
go build -tags 'dev' -o bin/build . \
:: ENVIRONMENT=DEVELOPMENT ./bin/build \
:: wgo -xdir=bin -xdir=node_modules -xdir=public node ./esbuild.config.js \
:: wgo -dir=node_modules npx livereload -w 400 public
:: wgo -dir=node_modules npx livereload -w 400 public
7 changes: 4 additions & 3 deletions template/base/package.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"esbuild": "^0.24.0"{{ if .Extras.HasHTMX }},
"htmx.org": "^1.9.12"{{ end }},
"livereload": "^0.9.3"{{ if .UI.HasPreline }},
"preline": "^2.5.1"{{ end }}{{ if .UI.HasTailwind }},
"preline": "^2.6.0"{{ end }}{{ if .UI.HasDaisy }},
"daisyui": "^4.12.14"{{ end }}{{ if .UI.HasTailwind }},
"esbuild-plugin-tailwindcss": "^1.2.1",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"tailwindcss": "^3.4.15"{{ end }}
"tailwindcss": "^3.4.16"{{ end }}
}
}
}
15 changes: 10 additions & 5 deletions template/base/tailwind.config.js.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['web/**/*.html'],
content: ["web/**/*.html"],
theme: {
extend: {},
},
darkMode: 'class',
darkMode: "class",
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
require('preline/plugin'),
{{- if .UI.HasDaisy }}
require("daisyui"),
{{- end }}
{{- if .UI.HasPreline }}
require("preline/plugin"),
{{- end }}
require("@tailwindcss/forms"),
require("@tailwindcss/typography"),
],
}
4 changes: 1 addition & 3 deletions util/rawdata_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ const (
</main>
</body>`
tailwindHomeBodyExampleHTML = `
<body
class="max-w-full bg-gray-300 dark:text-slate-200 text-black dark:bg-gray-950"
>
<body>
<!-- Container (MAX-WIDTH -> 48rem) -->
<main class="max-w-3xl mx-auto">
<div class="flex items-center gap-y-6 mt-4 flex-col justify-center">
Expand Down
1 change: 1 addition & 0 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func MakeProjectCtx(cfg StackConfig, modPath string) map[string]any {

// CSS Library
"HasPreline": cfg.UILibrary == "Preline",
"HasDaisy": cfg.UILibrary == "DaisyUI",
},
"Extras": map[string]bool{
"HasHTMX": contains(cfg.ExtraOpts, "HTMX"),
Expand Down
Loading