From 9fbb0014166d848d9ff6e0749db0b513c9a7f586 Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Sun, 26 Dec 2021 06:54:24 -0800 Subject: [PATCH] Fix overlarge padding-bottom in Ananke theme --- blog/layouts/partials/head-additions.html | 2 ++ blog/static/js/custom.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 blog/layouts/partials/head-additions.html create mode 100644 blog/static/js/custom.js diff --git a/blog/layouts/partials/head-additions.html b/blog/layouts/partials/head-additions.html new file mode 100644 index 0000000..e3fc9ad --- /dev/null +++ b/blog/layouts/partials/head-additions.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/blog/static/js/custom.js b/blog/static/js/custom.js new file mode 100644 index 0000000..b699dc5 --- /dev/null +++ b/blog/static/js/custom.js @@ -0,0 +1,18 @@ +// https://stackoverflow.com/a/70385342/1040915 +tweakBottomPadding(); + +function tweakBottomPadding() { + // The Ananke theme hard-codes `pb7` Tachyon (http://tachyons.io/) class (https://bit.ly/3myqBFy), + // leading to `padding-bottom: 16rem` which is (IMO) much too large. + // I could instead have overridden the `_default/baseof` layout, but I prefer to make small + // overrides rather than fork at a static version. + var main = document.getElementsByTagName('main')[0]; + // https://stackoverflow.com/a/16337545/1040915 + // I wish all IE8 users a very Not Fucking Working Internet. + if (main.classList.contains('pb7')) { + main.classList.add('pb5'); + main.classList.remove('pb7'); + } else { + console.log('`main` element does not have pb7 class - not replacing it') + } +}