From a5173616a7338bc7356cf1ceda8d9c8277cbb5f9 Mon Sep 17 00:00:00 2001
From: TrebledJ <39648915+TrebledJ@users.noreply.github.com>
Date: Tue, 11 Jun 2024 01:21:01 +0800
Subject: [PATCH] fix(site): bundle css and remove css minification
html-minifier uses cleancss. After testing a bit, it seems CleanCSS will the ENTIRE icon-table CSS styles... which, btw, is just a simple:
```css
.icon-table {
td {
text-align: center;
vertical-align: middle;
}
}
```
Why? IDK! It's utterly preposterous. What did this innocent CSS ever do to deserve this?!?
---
_includes/head.html | 1 +
...2024-05-23-optimising-web-icons-for-fun.md | 11 ++++-
eleventy.config.js | 2 +-
eleventy/shortcodes.js | 2 +-
package-lock.json | 41 ++++++++-----------
5 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/_includes/head.html b/_includes/head.html
index 72807df48..05d3676c7 100644
--- a/_includes/head.html
+++ b/_includes/head.html
@@ -21,6 +21,7 @@
{% endfor %}
{% endif %}
+
{% include "utilities/async-css.html" %}
{% include "utilities/theme-switch.html" %}
diff --git a/content/posts/programming/mini-projects/2024-05-23-optimising-web-icons-for-fun.md b/content/posts/programming/mini-projects/2024-05-23-optimising-web-icons-for-fun.md
index 2e2d13251..4037b88d4 100644
--- a/content/posts/programming/mini-projects/2024-05-23-optimising-web-icons-for-fun.md
+++ b/content/posts/programming/mini-projects/2024-05-23-optimising-web-icons-for-fun.md
@@ -80,7 +80,16 @@ It's a lot of indirection, and this is one reason why SVGs are preferred; but he
To complicate matters, FA fonts have different **variants**, and they modularise this by using the same codepoint, but separate font files. Not all fonts do this though. Devicon packs all their styles into a single font file. Here are some examples of FA styles.
-{% table "td {text-align: center; vertical-align: middle; }" %}
+{% css %}
+ .icon-table {
+ td {
+ text-align: center;
+ vertical-align: middle;
+ }
+ }
+{% endcss %}
+
+{% table "icon-table" %}
| | Solid | Regular | Brands |
|-------------------------|----------------------------------|----------------------------------|-------------------------------|
diff --git a/eleventy.config.js b/eleventy.config.js
index b997f46aa..906d720f8 100644
--- a/eleventy.config.js
+++ b/eleventy.config.js
@@ -88,7 +88,7 @@ module.exports = function (eleventyConfig) {
const minified = htmlmin.minify(content, {
removeComments: true,
includeAutoGeneratedTags: false,
- minifyCSS: true,
+ minifyCSS: false,
minifyJS: true,
collapseWhitespace: true,
collapseBooleanAttributes: true, // e.g. no