Skip to content
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

Upgrade to TailwindCSS v4 #8

Merged
merged 2 commits into from
Feb 5, 2025
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
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ RUN set -x && apt-get update && \
# The URL uses x64 instead of amd64
ARG BUILDARCH
RUN ARCH=$( [ "${BUILDARCH}" = "amd64" ] && echo "x64" || echo "arm64" ) && \
curl -sfLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-${ARCH}
curl -sfLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-${ARCH}
RUN mv tailwindcss-linux-* tailwindcss
RUN chmod a+x tailwindcss

COPY tailwind.css ./
COPY tailwind.config.js ./

COPY html ./html/

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ start: build-css
tailwindcss:
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-$(TAILWINDCSS_OS_ARCH)
mv tailwindcss-$(TAILWINDCSS_OS_ARCH) tailwindcss
chmod +x tailwindcss
mkdir -p node_modules/tailwindcss/lib && ln -s tailwindcss node_modules/tailwindcss/lib/cli.js
chmod a+x tailwindcss
mkdir -p node_modules/tailwindcss/lib && ln -sf tailwindcss node_modules/tailwindcss/lib/cli.js
echo '{"devDependencies": {"tailwindcss": "latest"}}' >package.json

.PHONY: test
Expand Down
2 changes: 1 addition & 1 deletion html/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func page(props PageProps, children ...Node) Node {

// header bar with logo and navigation.
func header() Node {
return Div(Class("bg-indigo-600 text-white shadow"),
return Div(Class("bg-indigo-600 text-white shadow-sm"),
container(true, false,
Div(Class("h-16 flex items-center justify-between"),
A(Href("/"), Class("inline-flex items-center text-xl font-semibold"),
Expand Down
2 changes: 1 addition & 1 deletion html/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func HomePage(props PageProps, things []model.Thing, now time.Time) Node {
H2(Text("Try HTMX")),

Button(
Class("rounded-md bg-indigo-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"),
Class("rounded-md bg-indigo-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"),
Text("Get things with HTMX"), hx.Get("/"), hx.Target("#things")),

Div(ID("things"),
Expand Down
21 changes: 0 additions & 21 deletions tailwind.config.js

This file was deleted.

5 changes: 2 additions & 3 deletions tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
@plugin "@tailwindcss/typography";