Posts about: GitHub Pages

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.

Read On →

Dynamic CSS color themes with similar contrasts

This blog is built with Emacs, SCSS using Nix and deployed as static files to GitHub Pages. This blog also has quite some colors due to the syntax highlighting for code that is performed using CSS rules on HTML classes.

So in total I have 15 different colors defined, in which four of them is background and foreground colors, two of them is related to link and visited link colors. Then I have nine colors remaining which are related to syntax highlighting of code.

Read On →