lewisdale.dev/src/blog/posts/2024/4/css-naked-day.md
Lewis Dale 5eab7bcb9d
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 2m13s
Fixing JSON feed
2024-04-29 19:15:50 +01:00

1.2 KiB

title description tags date excerpt
It's CSS Naked Day My blog is going naked for CSS naked day
css
2024-04-09T07:11:20.550Z It's CSS Naked Day, so to celebrate I've stripped all of the CSS from my blog.

It's CSS Naked Day1, so to celebrate I've stripped all of the CSS from my blog.

I've added a quick Nunjucks shortcode to make it easier, so the CSS should automagically reappear tomorrow morning:

{% raw %}

  eleventyConfig.addGlobalData('isCSSNakedDay', () => {
    const dateObj = new Date();

    return dateObj.getMonth() === 3 && dateObj.getFullYear() === 2024 && dateObj.getDate() === 9;
  });
{% if not isCSSNakedDay %}
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css">
{% endif %}

{% endraw %}

Thankfully I've not spotted any terrible layouts (yet) due to missing CSS, which I'm happy about. The colour scheme changer is a bit redundant though. I've also left the FontAwesome and Prism CSS files in, just because otherwise things'll stop rendering at all there which wouldn't be great for a lot of posts.


  1. Please only strip the CSS from your own websites, not your employers' ↩︎