update to tailwind v4

Signed-off-by: jolheiser <git@jolheiser.com>
main
jolheiser 2025-07-29 10:47:45 -05:00
parent a4df94c011
commit 36a93af5a6
No known key found for this signature in database
5 changed files with 13 additions and 34 deletions

View File

@ -18,11 +18,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1695806987,
"narHash": "sha256-fX5kGs66NZIxCMcpAGIpxuftajHL8Hil1vjHmjjl118=",
"lastModified": 1753399495,
"narHash": "sha256-7XG/QBqhrYOyA2houjRTL2NMa7IKZZ/somBqr+Q/6Wo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f3dab3509afca932f3f4fd0908957709bb1c1f57",
"rev": "0d00f23f023b7215b3f1035adb5247c8ec180dbc",
"type": "github"
},
"original": {
@ -60,11 +60,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1695841587,
"narHash": "sha256-fgiZd5AV+hi8Ne0bJ8SyAx5nppseW4aXJQEIDSr0VNA=",
"lastModified": 1753803577,
"narHash": "sha256-sE5IgsHacXmfsWJjVVPvb7Aa6oHElt+nfP6+3Pqa414=",
"ref": "refs/heads/main",
"rev": "afca060674b20e0ccecde2d6fe88c887790219a5",
"revCount": 1,
"rev": "4ce9431cbb4e9e5dceadfbc413fbd34e7305fe8e",
"revCount": 3,
"type": "git",
"url": "https://git.jolheiser.com/tailwind-ctp"
},

View File

@ -30,7 +30,7 @@
in
{
overlays.default = final: prev: {
tailwind-ctp = inputs.tailwind-ctp.packages.${prev.system}.default;
tailwind-ctp = inputs.tailwind-ctp.packages.${prev.system}.v4;
tailwind-ctp-lsp = inputs.tailwind-ctp-lsp.packages.${prev.system}.default;
};
packages = forAllSystems (

17
main.go
View File

@ -18,14 +18,8 @@ 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 -i ./dist/styles.css -o ./dist/styles.css --minify
//go:generate tailwind-ctp-mocha -o ./dist/styles.css --minify
func main() {
var links struct {
Links []Link `json:"links"`
@ -54,13 +48,4 @@ func main() {
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)
}
}

View File

@ -22,16 +22,16 @@ func index(links []Link) g.Node {
h.Link(h.Rel("stylesheet"), h.Href("styles.css")),
},
Body: []g.Node{
h.Class("latte dark:mocha bg-base"),
h.Class("bg-ctp-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-lavender"),
h.P(h.Class("mt-2 text-xl text-center text-ctp-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-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),
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),
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 @@ func index(links []Link) g.Node {
),
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-surface2 p-3 rounded w-1/5"),
h.Div(h.Class("bg-ctp-surface2 p-3 rounded w-1/5"),
g.Raw(qr),
),
),

View File

@ -1,6 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./dist/*.html"],
plugins: [require("@catppuccin/tailwindcss")],
}