Computing contrast colors without dart-sass
Back in 2021 I wrote about dynamic CSS color themes with similar contrasts, where I used a SCSS function to automatically adjust colors to meet the WCAG 7:1 contrast ratio against both a light and a dark background. The idea was that you specify the intent — the hue you want — and the build system derives the actual color that achieves sufficient contrast.
That worked well, but it required dart-sass. Hugo’s built-in LibSass was
removed in Hugo 0.128, leaving dart-sass as the only SCSS transpiler. Getting
dart-sass into the Nix build required a symlinkJoin bundle that wrapped Hugo
with dart-sass on its PATH — not terrible, but an extra moving part in both
devshell.nix and packages/default.nix.