Skip to content

Pull along Tailwind configuration, generating CSS again#617

Open
dschrempf wants to merge 14 commits into
haskellfoundation:hakyllfrom
dschrempf:tailwind
Open

Pull along Tailwind configuration, generating CSS again#617
dschrempf wants to merge 14 commits into
haskellfoundation:hakyllfrom
dschrempf:tailwind

Conversation

@dschrempf

@dschrempf dschrempf commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Restores Tailwind + PostCSS compilation of main.css, matching the old (Tailwind v2-era) visual output as closely as possible, then migrates the config to Tailwind v4's CSS-native @theme/@source setup (no more tailwind.config.js).
  • Adds a dev.css snapshot committed to the repo so stack exec site build/watch still works without Node — site.hs concatenates it onto tailwind.css at compile time.
  • Adds a Nix flake dev shell (replacing the old, unused dep/nixpkgs/dep/node node2nix setup) providing node/npm for anyone who does need to rebuild the real CSS.
  • Adds a CI step that builds the production CSS with npm as part of the site build.
  • Documents the whole Node/Tailwind/PostCSS workflow in the README.
  • Minor follow-up: sets headings back to weight 400 and drops the now-unused font-w-800 utility.

The website content remains unchanged.

Review concerns of #281 already addressed at this stage of the PR:

  • README explains when Node is needed
  • Adapt "nodejs nonsense" comment
  • hackyll typos + wrong paths + ambiguous "this file" wording (tailwind.css header)

Review concerns not yet addressed:

  • cat-based concat breaks Windows (site.hs:41)
  • Isolate Node/node_modules into its own dir
  • CI drift-check for dev.css

Review concerns that are not valid anymore due to upgrade to Tailwind 4

  • tailwind.config.js "3"→"3px" nit

Note: 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.

hazelweakly and others added 12 commits July 7, 2026 17:14
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.
@dschrempf

Copy link
Copy Markdown
Collaborator Author

Pulling @LaurentRDC @jaspervdj in.

Comment thread site.hs
Comment thread site.hs Outdated
Comment thread README.md
Comment on lines +65 to +69
```bash
npm ci # once, to install the toolchain
npm run build # compile -> _site/assets/css/tailwind.css
npm run build:production # minified build (NODE_ENV=production)
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a nix flake in this repo -- can we list the steps to use that flake if one doesn't want to install npm globally?

Comment thread site.hs
config :: Configuration
config = defaultConfiguration
{ ignoreFile = \file ->
"node_modules" `isPrefixOf` file ||

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this here in e769aa5, rather than having the ignore on individual matches.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will apply the commit. I guess this will also have consequences on "isolating node_modules", which is still an open task.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I saw that you already applied it yourself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants