From 01f85bd09805f8f93710e66f48e5e988e1cad0ae Mon Sep 17 00:00:00 2001 From: ekzyis Date: Wed, 10 Jul 2024 06:11:28 +0200 Subject: [PATCH] Setup tailwindcss --- .gitignore | 5 +++- Makefile | 2 ++ hotreload.sh | 1 + public/css/_tw-input.css | 41 +++++++++++++++++++++++++++++++++ server/router/pages/index.templ | 14 +++++------ tailwind.config.js | 12 ++++++++++ 6 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 public/css/_tw-input.css create mode 100644 tailwind.config.js diff --git a/.gitignore b/.gitignore index ba54f98..b220c76 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,7 @@ public/hotreload *.log # templ -*_templ.go \ No newline at end of file +*_templ.go + +# tailwindcss +public/css/tailwind.css diff --git a/Makefile b/Makefile index 8aa56b0..b400f44 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,12 @@ SOURCE := $(shell find db env lib lnd pages public server -type f) main.go build: delphi.market delphi.market: $(SOURCE) + tailwindcss -i public/css/_tw-input.css -o public/css/tailwind.css templ generate -path server/router/pages go build -o delphi.market . run: + tailwindcss -i public/css/_tw-input.css -o public/css/tailwind.css templ generate -path server/router/pages go run . diff --git a/hotreload.sh b/hotreload.sh index de2f4b8..b3c7d41 100755 --- a/hotreload.sh +++ b/hotreload.sh @@ -9,6 +9,7 @@ function restart_server() { [[ -z "$PID" ]] || kill -15 $PID ENV=development make build -B set -e + tailwindcss -i public/css/_tw-input.css -o public/css/tailwind.css templ generate -path server/router/pages go build -o delphi.market . ./delphi.market >> server.log 2>&1 & diff --git a/public/css/_tw-input.css b/public/css/_tw-input.css new file mode 100644 index 0000000..056446d --- /dev/null +++ b/public/css/_tw-input.css @@ -0,0 +1,41 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --background-color: #191d21; + --color: #d3d3d3; + --muted-color: #6c757d; +} + +@layer base { + body { + background-color: var(--background-color); + color: var(--color); + transition: background-color 150ms ease-in; + } + + footer { + color: var(--muted-color); + } + + hr { + border-color: var(--muted-color); + border-style: dashed; + @apply pb-1; + } + + a { + text-decoration: underline; + transition: background-color 150ms ease-in, color 150ms ease-in; + } + + a:hover { + background-color: var(--color); + color: var(--background-color); + } + + nav>a { + padding: 0 0.25em; + } +} \ No newline at end of file diff --git a/server/router/pages/index.templ b/server/router/pages/index.templ index 9c68a64..c332506 100644 --- a/server/router/pages/index.templ +++ b/server/router/pages/index.templ @@ -14,7 +14,7 @@ templ Index() { - + @@ -22,8 +22,8 @@ templ Index() { } - -
+ +
-
- +
+
@@ -48,9 +48,9 @@ templ Index() {
 						
-
A prediction market using the lightning network [WIP]
+
A prediction market using the lightning network
-