From 9694ae71bcfd8ec8b4e2ac3c6905bbbbfd2353b1 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 4 Jul 2022 20:27:08 +0100 Subject: [PATCH] Use fira code for code blocks --- package-lock.json | 11 +++++++++++ package.json | 1 + scripts/copy-npm-contrib.sh | 1 + static/src/scss/_blocks.scss | 8 ++++++++ website/common/templates/common/content_page.html | 1 + 5 files changed, 22 insertions(+) diff --git a/package-lock.json b/package-lock.json index 2137d12..daaa1b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "bulma": "^0.9.4", "darkreader": "^4.9.51", "elevator.js": "^1.0.1", + "firacode": "^6.2.0", "lite-youtube-embed": "^0.2.0", "shareon": "^2.0.0" }, @@ -658,6 +659,11 @@ "node": ">=8" } }, + "node_modules/firacode": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/firacode/-/firacode-6.2.0.tgz", + "integrity": "sha512-t5R3aO2BmhRXnYtKXbImLVNsILuCIbJ/XlDzBufjpi3il8P/CVdpWco83Ud3r2Tl0gitAmyP4o1fbJ52ozV1jw==" + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -1997,6 +2003,11 @@ "to-regex-range": "^5.0.1" } }, + "firacode": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/firacode/-/firacode-6.2.0.tgz", + "integrity": "sha512-t5R3aO2BmhRXnYtKXbImLVNsILuCIbJ/XlDzBufjpi3il8P/CVdpWco83Ud3r2Tl0gitAmyP4o1fbJ52ozV1jw==" + }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", diff --git a/package.json b/package.json index c2ea4a9..4224b70 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "bulma": "^0.9.4", "darkreader": "^4.9.51", "elevator.js": "^1.0.1", + "firacode": "^6.2.0", "lite-youtube-embed": "^0.2.0", "shareon": "^2.0.0" } diff --git a/scripts/copy-npm-contrib.sh b/scripts/copy-npm-contrib.sh index 42b1eea..b9a7798 100755 --- a/scripts/copy-npm-contrib.sh +++ b/scripts/copy-npm-contrib.sh @@ -18,3 +18,4 @@ mkcontrib() { mkcontrib fontawesome node_modules/@fortawesome/fontawesome-free/{css,webfonts} mkcontrib elevator-js node_modules/elevator.js/demo/music/* mkcontrib shareon node_modules/shareon/dist/{shareon.iife.*,shareon.min.css*} +mkcontrib fira-code node_modules/firacode/distr/{fira_code.css,woff2,woff} diff --git a/static/src/scss/_blocks.scss b/static/src/scss/_blocks.scss index 8e6b0cb..ebd5edc 100644 --- a/static/src/scss/_blocks.scss +++ b/static/src/scss/_blocks.scss @@ -34,3 +34,11 @@ div.block-embed { @include center-block(50%); } } + +div.block-code { + code, + pre { + font-family: "Fira Code", monospace; + font-variant-ligatures: none; + } +} diff --git a/website/common/templates/common/content_page.html b/website/common/templates/common/content_page.html index c06adcd..c4eaf2a 100644 --- a/website/common/templates/common/content_page.html +++ b/website/common/templates/common/content_page.html @@ -17,6 +17,7 @@ {% block extra_css %} + {% endblock %}