

Covers that change with your theme
My site has seven colour themes, but a cover is one image. An AI model paints the light in two colours I never show, a script turns them into masks, and CSS recolours it to match the theme.
31 posts with this tag.


My site has seven colour themes, but a cover is one image. An AI model paints the light in two colours I never show, a script turns them into masks, and CSS recolours it to match the theme.


24 of my posts had no cover, so I spent a day testing Krea 2 on my own PC. What each prompt change and LoRA did, where the memory went, and the two components I built to compare the images.


I had more than 200 cover drafts to choose from, so I built a page to pick them. It's a Vite plugin that only runs in development, uses the same code as my commands, and turns away requests from other sites.


A code block in my posts can now run: the page shows what the code makes above the code itself. In the CMS, where my GitHub token lives, the same demo runs in a sandboxed frame that can't reach it.


Since my posts are Svelte components, they can hold components too. I write them as directives: a colon, a name and some brackets, no HTML. Keycaps, a section you open, two things side by side, steps, tabs and a table of contents, each one a few lines of Svelte and drawn in the site's own look.


Once my posts became Svelte components, the CMS preview had nothing to mount until the post was compiled. So it compiles it, in the browser, the way the build does: mdsvex, then Svelte's compiler, then a module whose imports point at the CMS's own copies. All 72 posts preview exactly as the site shows them.


My Awesome lists each have a Lucide icon, chosen by name. Typing names from a website is no way to pick an icon, so the CMS got a field of its own, a Svelte component inside a React app, with the icon names read from the package at build time.


My 404 page now picks one of four toys at random, Breakout, Snake, an ASCII wave and loose dots, all made of the 404 itself. How it works on GitHub Pages, and why the game rules have no canvas in them.


My footer now opens a panel about me and how to hire me, with a top card that changes look every time: a terminal, a spotlight, a business card, an open-to-work card and an ID card in 3D. How each one works, and how to keep five effects calm.


I replaced mdsvex with svelte-markdown. Posts are rendered on the server by my own components, the CMS preview mounts the same ones, and every page got lighter.


Importing Sveltia CMS from npm instead of serving its files made my setup half the size. On the way: a deadlock with no error, a bundler that lost the fonts, and a React effect that returned the wrong thing.


My CMS showed a preview of something that wasn't my site. Four tries later, it draws the post with the same Svelte components as the page, in the browser, as I type.


My site has a new toolbox, with ideas picked from several open-source collections. Before borrowing anything I read their licences, and ended up removing a credit line I had just added.


My blog page opened with a wall of 55 tag links. Now it's a sidebar of coloured chips, most used first, that fades out into a button, and what fades out is really gone for the keyboard too.


Three of my pages scored under 90 in Lighthouse for one reason, content moving after it appears. Two causes, web fonts and content added by JavaScript, and how I fixed each.


Where to keep a blog's images, why  breaks on a prerendered site, and a small Vite plugin step that turns it into optimized, checked images.


A collapsible section that works without JS, opens by itself as you scroll, respects what you chose, and doesn't hide its content from find in page.


My CV builder lets me edit the skills for each job profile. Saving my changes to the list, instead of a copy of it, kept the site's data in charge, and one ??= taught me about Svelte's proxies.


My about page now filters skills by the kind of job I'm applying for. One choice at a time means radio buttons, and :has() lets me style them without giving up what the browser does for free.


The effects on my about page, and the bugs behind each one. An animation that never animated, an observer that never saw, and 168 KB of duplicate SVG.


My CV builder keeps what I type in the browser, never on a server. One $state object, an $effect to save it, and a select that taught me events don't always arrive in the order I think.


A $state class for an Awesome list's filters, $derived results, and a URL you can share, on a page that's prerendered.


Wrapping long lines, numbering them with a CSS counter and adding a copy button that only shows up when it works, around Shiki's HTML.


Where to learn how Svelte styles components, from the official tutorial to videos, plus the playground experiments that finally made scoped styles click for me.


What the Svelte compiler does to a component's style block, why a page's styles couldn't reach my rendered markdown, and when :global() or a global class is the right fix.


My home page keeps the intro in view while the sections scroll past, and a small nav shows which section you're reading. position sticky, a few lines of measuring on scroll, and proximity snapping that only applies to one page.


A graph-paper background made of four gradients, plus marks drawn with a mask, and a spotlight that lights up the grid around your mouse. One fixed layer, no images, and it follows the theme.


My theme toggle became a sun that turns into a moon, and the new theme now grows out of the button in a circle. An SVG mask, one number token, and the View Transition API.


How I typed my hero component's props, made links that can't point to a missing page, and handled empty lists, with a few TypeScript tricks along the way.


Why my hero component doesn't animate itself, how the page passes it animations as CSS props, and a reduced-motion safety net that actually covers delays.


Dark mode for my SvelteKit portfolio. Theme colors live in tokens.css using color-scheme and light-dark(), and a toggle overrides the OS setting.