diff --git a/flake.lock b/flake.lock index f89538c39cf694f5c54a43ee8e3a349e4dad5dc7..43b34a70f2dd490b351bb3bd66311533532bee78 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ } }, "nixpkgs_2": { "locked": { - "lastModified": 1753399495, - "narHash": "sha256-7XG/QBqhrYOyA2houjRTL2NMa7IKZZ/somBqr+Q/6Wo=", + "lastModified": 1695806987, + "narHash": "sha256-fX5kGs66NZIxCMcpAGIpxuftajHL8Hil1vjHmjjl118=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0d00f23f023b7215b3f1035adb5247c8ec180dbc", + "rev": "f3dab3509afca932f3f4fd0908957709bb1c1f57", "type": "github" }, "original": { @@ -60,11 +60,11 @@ "inputs": { "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1753803577, - "narHash": "sha256-sE5IgsHacXmfsWJjVVPvb7Aa6oHElt+nfP6+3Pqa414=", + "lastModified": 1695841587, + "narHash": "sha256-fgiZd5AV+hi8Ne0bJ8SyAx5nppseW4aXJQEIDSr0VNA=", "ref": "refs/heads/main", - "rev": "4ce9431cbb4e9e5dceadfbc413fbd34e7305fe8e", - "revCount": 3, + "rev": "afca060674b20e0ccecde2d6fe88c887790219a5", + "revCount": 1, "type": "git", "url": "https://git.jolheiser.com/tailwind-ctp" }, diff --git a/flake.nix b/flake.nix index dd88259907bbc4b8385cf61324a3f433c1d5b26b..c7e940181b4239d9cc36027852258e77eb879569 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,7 @@ ); in { overlays.default = final: prev: { - tailwind-ctp = inputs.tailwind-ctp.packages.${prev.system}.v4; + tailwind-ctp = inputs.tailwind-ctp.packages.${prev.system}.default; tailwind-ctp-lsp = inputs.tailwind-ctp-lsp.packages.${prev.system}.default; }; packages = forAllSystems ( diff --git a/main.go b/main.go index 7df11bc4eb3f97e1006b84faf55a4c24b350570e..7301df3a263c5d868e9e50a9436ac1d829666d19 100644 --- a/main.go +++ b/main.go @@ -18,8 +18,14 @@ func (l Link) Icon() simpleicons.Icon { return simpleicons.Icons[l.IconName] } +var tailwindCSS = ` +@tailwind base; +@tailwind components; +@tailwind utilities; +` + //go:generate go run . -//go:generate tailwind-ctp-mocha -o ./dist/styles.css --minify +//go:generate tailwind-ctp -i ./dist/styles.css -o ./dist/styles.css --minify func main() { var links struct { Links []Link `json:"links"` @@ -46,6 +52,15 @@ defer html.Close() err = index(links.Links).Render(html) if err != nil { + panic(err) + } + + css, err := os.Create("dist/styles.css") + if err != nil { + panic(err) + } + defer css.Close() + if _, err := css.WriteString(tailwindCSS); err != nil { panic(err) } } diff --git a/site.go b/site.go index 7e640c57a0f674a2106133deae85092e4827534c..738c3800df00d194a6a1d87ba8d08b462bdaf04b 100644 --- a/site.go +++ b/site.go @@ -22,16 +22,16 @@ h.Meta(h.Name("author"), h.Content("jolheiser")), h.Link(h.Rel("stylesheet"), h.Href("styles.css")), }, Body: []g.Node{ - h.Class("bg-ctp-base"), + h.Class("latte dark:mocha bg-base"), h.Header(h.Class("relative w-full pt-16 pb-10"), h.Img(h.Class("mx-auto rounded-full"), h.Alt("avatar"), h.Src("https://www.gravatar.com/avatar/7f4dd86f017ff289cf05a013e22357ef253d1ed6a52bdefca8f965af1080a965?s=125")), - h.P(h.Class("mt-2 text-xl text-center text-ctp-lavender"), + h.P(h.Class("mt-2 text-xl text-center text-lavender"), g.Text("@jolheiser"), ), ), h.Nav(h.Class("relative max-w-screen-sm mx-auto"), g.Map(links, func(link Link) g.Node { - return h.A(h.Class("flex relative px-3 py-2 my-6 h-16 text-lg items-center justify-center text-ctp-text bg-ctp-surface0 cursor-pointer rounded border-solid border-2 border-overlay0 hover:bg-ctp-surface2 hover:border-ctp-lavender hover:text-ctp-blue transition"), h.Title(link.Name), h.Target("_blank"), h.Href(link.URL), + return h.A(h.Class("flex relative px-3 py-2 my-6 h-16 text-lg items-center justify-center text-text bg-surface0 cursor-pointer rounded border-solid border-2 border-overlay0 hover:bg-surface2 hover:border-lavender hover:text-blue transition"), h.Title(link.Name), h.Target("_blank"), h.Href(link.URL), h.SVG(h.Class("absolute left-5 w-10 h-10"), h.Role("img"), ViewBox(0, 0, 24, 24), XMLNS(), h.Title(link.Icon().Title), Path(Fill("#"+link.Icon().Hex), D(link.Icon().Path)), @@ -42,7 +42,7 @@ }), ), h.Footer(h.Class("relative w-full max-w-screen-sm mx-auto mt-10 pb-8 text-center"), h.Div(h.Class("flex justify-center items-center"), - h.Div(h.Class("bg-ctp-surface2 p-3 rounded w-1/5"), + h.Div(h.Class("bg-surface2 p-3 rounded w-1/5"), g.Raw(qr), ), ), diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000000000000000000000000000000000000..840ef08d281085ff048be30b84f20a932f9c8e16 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,6 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./dist/*.html"], + plugins: [require("@catppuccin/tailwindcss")], +} +