Pull along Tailwind configuration, generating CSS again#617
Conversation
Config moves from tailwind.config.js (deleted) into assets/css/tailwind.css (@theme/@source/@plugin); postcss.config.js uses @tailwindcss/postcss and drops postcss-import. Regenerate the dev.css snapshot. Address PR haskellfoundation#281 review: the README now documents when Node is needed vs. the Node-free dev.css preview, gives Stack and Cabal equal billing (and fixes the broken 'cabal run -- site build' invocation), and updates the stale CI step list. Drop the disparaging site.hs comment and fix the hakyll typos, wrong paths, and ambiguous wording in the tailwind.css header.
The heading rule asked for 700, but the Google Fonts link only loads Playfair Display 400/600/800, so headings snapped to 800 (extra-bold). Regular reads better across the site. With headings now 400, the font-w-800 utility (only on the homepage hero) was dead, so remove its @theme token and the class.
|
Pulling @LaurentRDC @jaspervdj in. |
| config :: Configuration | ||
| config = defaultConfiguration | ||
| { ignoreFile = \file -> | ||
| "node_modules" `isPrefixOf` file || |
There was a problem hiding this comment.
I moved this here in e769aa5, rather than having the ignore on individual matches.
There was a problem hiding this comment.
Thanks, I will apply the commit. I guess this will also have consequences on "isolating node_modules", which is still an open task.
There was a problem hiding this comment.
Oh, I saw that you already applied it yourself!
dev.css is a checked-in snapshot of `npm run build` (concatenated onto tailwind.css by site.hs for Node-less previews). Add `npm run build:dev-snapshot` as the single canonical regeneration command (writes dev.css in place) and a CI step that runs it and fails via `git diff` if the committed copy is stale.
|
Last TODO: Isolate node tooling. There is a potential followup: We are using "custom font size utilities with standard Tailwind prefixes" (e.g., |
Move `package.json`, `package-lock.json`, `postcss.config.js` and `node_modules` out of the repo root into `tools/tailwind/`, so the Node and Hakyll build systems no longer share a directory (PR haskellfoundation#281 review). The build still runs from the repo root — Tailwind v4's `@source` only scans at/below the CWD — so the npm scripts `cd` back up. Since `node_modules` is no longer an ancestor of `assets/css/tailwind.css`, that file's `@import/@plugin` use relative paths into `tools/tailwind/node_modules`. Hakyll's ignoreFile now skips `tools/` instead of `node_modules`. Output is byte-identical to the pre-move build.
|
OK, moved Tailwind/Node stuff to If there are no more review requests or objections, I would merge maybe tomorrow or the day after tomorrow. @LaurentRDC @jaspervdj |
|
Fine by me! |
Late-stage draft (there are a few things to do, see below).
This supersedes #281.
This PR (#281) reintroduces a working, checked-in Tailwind/PostCSS build for assets/css/main.css after it had bitrotted, and wires it into both local dev and CI:
The website content remains unchanged.
Review concerns of #281 already addressed at this stage of the PR:
hackylltypos + wrong paths + ambiguous "this file" wording (tailwind.cssheader)Review concerns not yet addressed:
cat-based concat breaks Windows (site.hs:41)node_modulesinto its own dirdev.cssReview concerns that are not valid anymore due to upgrade to Tailwind 4
tailwind.config.js"3"→"3px"nitNote: Some of this work was done by an LLM; I have reviewed all changes and tested the local site builds, but I am declaring this here, since there are ongoing discussions about the use of LLMs in the Haskell community.