eleventyΣ=2

ARTICLE  
Our Cache Busting Setup on Eleventy

Our Cache Busting Setup on Eleventy

Cache busting is necessary because browsers cache the resources, namely, CSS and JS files, and if we update the website, visitors might not see their latest versions.

In theory, implementing web workers should solve the cache busting problem, and there are Eleventy pluginsopens in a new tab for that, but, we decided not to enable the PWA setup until we test it properly.

Here's how we bust the cache in an old-school way, on Eleventy + Nunjucks + Parcel.

Read article Our Cache Busting Setup on Eleventy
ARTICLE  
Our Dark Mode Setup

Our Dark Mode Setup

Conceptually, dark/light mode on a website is driven by the buttons on the UI: whichever mode user picks, a data-theme attribute with that value gets set on <html> tag. We also persist that to browser's local storage.

Automatic mode setting "listens" to system's setting via @media (prefers-color-scheme: dark). Manual dark/light modes' CSS "listens" to <html> tag attribute's value by :root[data-theme='dark'].

That's pretty much it.

Here is the mixin we use.

Read article Our Dark Mode Setup