From a5f16ca54f790906d15986186fa904cd469b2ce3 Mon Sep 17 00:00:00 2001 From: daudix Date: Sun, 15 Sep 2024 03:49:59 +0300 Subject: [PATCH] Optional bundled fonts (fixes #44). Style cleanups --- CHANGELOG.md | 4 ++ config.toml | 5 ++ content/demo/index.md | 2 +- content/demo/page.md | 2 - content/tricks/index.md | 8 ++- sass/_article-list.scss | 7 +-- sass/_buttons.scss | 6 +-- sass/_code.scss | 4 +- sass/_comments.scss | 14 +++-- sass/_footer.scss | 10 ++-- sass/_general.scss | 3 +- sass/_icon.scss | 2 +- sass/_nav.scss | 13 +++-- sass/_post-nav.scss | 4 +- sass/_pre-container.scss | 1 - sass/_statements.scss | 21 ++++---- sass/_tags.scss | 7 +-- sass/_typography.scss | 48 ++++++++++++----- sass/fonts.scss | 56 ++++++++++++++++++++ static/fonts/InterVariable-Italic.woff2 | Bin 0 -> 380904 bytes static/fonts/InterVariable.woff2 | Bin 0 -> 345588 bytes static/fonts/JetBrainsMono-Italic.woff2 | Bin 0 -> 122500 bytes static/fonts/JetBrainsMono.woff2 | Bin 0 -> 113432 bytes static/fonts/KaTeX_AMS-Regular.ttf | Bin 63632 -> 0 bytes static/fonts/KaTeX_AMS-Regular.woff | Bin 33516 -> 0 bytes static/fonts/KaTeX_Caligraphic-Bold.ttf | Bin 12368 -> 0 bytes static/fonts/KaTeX_Caligraphic-Bold.woff | Bin 7716 -> 0 bytes static/fonts/KaTeX_Caligraphic-Regular.ttf | Bin 12344 -> 0 bytes static/fonts/KaTeX_Caligraphic-Regular.woff | Bin 7656 -> 0 bytes static/fonts/KaTeX_Fraktur-Bold.ttf | Bin 19584 -> 0 bytes static/fonts/KaTeX_Fraktur-Bold.woff | Bin 13296 -> 0 bytes static/fonts/KaTeX_Fraktur-Regular.ttf | Bin 19572 -> 0 bytes static/fonts/KaTeX_Fraktur-Regular.woff | Bin 13208 -> 0 bytes static/fonts/KaTeX_Main-Bold.ttf | Bin 51336 -> 0 bytes static/fonts/KaTeX_Main-Bold.woff | Bin 29912 -> 0 bytes static/fonts/KaTeX_Main-BoldItalic.ttf | Bin 32968 -> 0 bytes static/fonts/KaTeX_Main-BoldItalic.woff | Bin 19412 -> 0 bytes static/fonts/KaTeX_Main-Italic.ttf | Bin 33580 -> 0 bytes static/fonts/KaTeX_Main-Italic.woff | Bin 19676 -> 0 bytes static/fonts/KaTeX_Main-Regular.ttf | Bin 53580 -> 0 bytes static/fonts/KaTeX_Main-Regular.woff | Bin 30772 -> 0 bytes static/fonts/KaTeX_Math-BoldItalic.ttf | Bin 31196 -> 0 bytes static/fonts/KaTeX_Math-BoldItalic.woff | Bin 18668 -> 0 bytes static/fonts/KaTeX_Math-Italic.ttf | Bin 31308 -> 0 bytes static/fonts/KaTeX_Math-Italic.woff | Bin 18748 -> 0 bytes static/fonts/KaTeX_SansSerif-Bold.ttf | Bin 24504 -> 0 bytes static/fonts/KaTeX_SansSerif-Bold.woff | Bin 14408 -> 0 bytes static/fonts/KaTeX_SansSerif-Italic.ttf | Bin 22364 -> 0 bytes static/fonts/KaTeX_SansSerif-Italic.woff | Bin 14112 -> 0 bytes static/fonts/KaTeX_SansSerif-Regular.ttf | Bin 19436 -> 0 bytes static/fonts/KaTeX_SansSerif-Regular.woff | Bin 12316 -> 0 bytes static/fonts/KaTeX_Script-Regular.ttf | Bin 16648 -> 0 bytes static/fonts/KaTeX_Script-Regular.woff | Bin 10588 -> 0 bytes static/fonts/KaTeX_Size1-Regular.ttf | Bin 12228 -> 0 bytes static/fonts/KaTeX_Size1-Regular.woff | Bin 6496 -> 0 bytes static/fonts/KaTeX_Size2-Regular.ttf | Bin 11508 -> 0 bytes static/fonts/KaTeX_Size2-Regular.woff | Bin 6188 -> 0 bytes static/fonts/KaTeX_Size3-Regular.ttf | Bin 7588 -> 0 bytes static/fonts/KaTeX_Size3-Regular.woff | Bin 4420 -> 0 bytes static/fonts/KaTeX_Size4-Regular.ttf | Bin 10364 -> 0 bytes static/fonts/KaTeX_Size4-Regular.woff | Bin 5980 -> 0 bytes static/fonts/KaTeX_Typewriter-Regular.ttf | Bin 27556 -> 0 bytes static/fonts/KaTeX_Typewriter-Regular.woff | Bin 16028 -> 0 bytes static/katex.css | 40 +++++++------- templates/article.html | 1 + templates/partials/head.html | 4 ++ 66 files changed, 172 insertions(+), 90 deletions(-) create mode 100644 sass/fonts.scss create mode 100644 static/fonts/InterVariable-Italic.woff2 create mode 100644 static/fonts/InterVariable.woff2 create mode 100644 static/fonts/JetBrainsMono-Italic.woff2 create mode 100644 static/fonts/JetBrainsMono.woff2 delete mode 100644 static/fonts/KaTeX_AMS-Regular.ttf delete mode 100644 static/fonts/KaTeX_AMS-Regular.woff delete mode 100644 static/fonts/KaTeX_Caligraphic-Bold.ttf delete mode 100644 static/fonts/KaTeX_Caligraphic-Bold.woff delete mode 100644 static/fonts/KaTeX_Caligraphic-Regular.ttf delete mode 100644 static/fonts/KaTeX_Caligraphic-Regular.woff delete mode 100644 static/fonts/KaTeX_Fraktur-Bold.ttf delete mode 100644 static/fonts/KaTeX_Fraktur-Bold.woff delete mode 100644 static/fonts/KaTeX_Fraktur-Regular.ttf delete mode 100644 static/fonts/KaTeX_Fraktur-Regular.woff delete mode 100644 static/fonts/KaTeX_Main-Bold.ttf delete mode 100644 static/fonts/KaTeX_Main-Bold.woff delete mode 100644 static/fonts/KaTeX_Main-BoldItalic.ttf delete mode 100644 static/fonts/KaTeX_Main-BoldItalic.woff delete mode 100644 static/fonts/KaTeX_Main-Italic.ttf delete mode 100644 static/fonts/KaTeX_Main-Italic.woff delete mode 100644 static/fonts/KaTeX_Main-Regular.ttf delete mode 100644 static/fonts/KaTeX_Main-Regular.woff delete mode 100644 static/fonts/KaTeX_Math-BoldItalic.ttf delete mode 100644 static/fonts/KaTeX_Math-BoldItalic.woff delete mode 100644 static/fonts/KaTeX_Math-Italic.ttf delete mode 100644 static/fonts/KaTeX_Math-Italic.woff delete mode 100644 static/fonts/KaTeX_SansSerif-Bold.ttf delete mode 100644 static/fonts/KaTeX_SansSerif-Bold.woff delete mode 100644 static/fonts/KaTeX_SansSerif-Italic.ttf delete mode 100644 static/fonts/KaTeX_SansSerif-Italic.woff delete mode 100644 static/fonts/KaTeX_SansSerif-Regular.ttf delete mode 100644 static/fonts/KaTeX_SansSerif-Regular.woff delete mode 100644 static/fonts/KaTeX_Script-Regular.ttf delete mode 100644 static/fonts/KaTeX_Script-Regular.woff delete mode 100644 static/fonts/KaTeX_Size1-Regular.ttf delete mode 100644 static/fonts/KaTeX_Size1-Regular.woff delete mode 100644 static/fonts/KaTeX_Size2-Regular.ttf delete mode 100644 static/fonts/KaTeX_Size2-Regular.woff delete mode 100644 static/fonts/KaTeX_Size3-Regular.ttf delete mode 100644 static/fonts/KaTeX_Size3-Regular.woff delete mode 100644 static/fonts/KaTeX_Size4-Regular.ttf delete mode 100644 static/fonts/KaTeX_Size4-Regular.woff delete mode 100644 static/fonts/KaTeX_Typewriter-Regular.ttf delete mode 100644 static/fonts/KaTeX_Typewriter-Regular.woff diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf29c6..f813b12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `--dim-opacity` CSS variable for setting opacity of dimmed elements. - Add `--disabled-opacity` CSS variable for setting opacity of disabled elements. - Add `--hover` CSS variable for setting zoom on hover. +- Add `config.extra.bundled_fonts` config variable to use custom fonts instead of system. - Add `external` class to comment timestamp. - Add `h1` with page/section title by default. - Add active state to footer's "Powered by" links. @@ -42,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow opening original comment attachment by clicking on it. - Allow overriding the `body` block of `base.html. - Allow statements on all sections except for the homepage. +- Change font sizes to [absolute sizes](https://developer.mozilla.org/en-US/docs/Web/CSS/absolute-size). - Change the way 404 image is resized (#74). - Improved CRT style, now looks a lot more like [cool-retro-term](https://github.com/Swordfish90/cool-retro-term). - Make comment timestamp more subtle. @@ -51,11 +53,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reduce the target heading transition time. - Reduce top margin of the target heading. - Remove bottom margin of `:last-child` and not `:last-of-type`. +- Remove legacy KaTeX font variants. - Rewrite the homepage (#75). - Set animation/transition duration to 0s with `prefers-reduced-motion' instead of removing them altogether. - Set socials icons as CSS variables and not inline styles. - Show theme switcher if `config.extra.default_theme` is set, even if `config.extra.nav.show_theme_switcher` is not. - Tweak `kbd` styling. +- Tweak margins instead of relying on `line-height`. - Tweak padding of verified instance badge. - Use more fitting cursors in some contexts. - Use PNG instead of GIF for comments QR code to reduce download size. diff --git a/config.toml b/config.toml index c814910..248da62 100644 --- a/config.toml +++ b/config.toml @@ -76,6 +76,11 @@ accent_color_dark = "#ffa348" # # Ditto but for the dark theme. fix_contrast_dark = true +# Whether to use fonts bundled with Duckquill instead of system ones. +# Keep in mind that it also changes the style of headings. +# +# bundled_fonts = true +# # Use emoji as a favicon. # Only one emoji is being rendered, everything else is truncated. # diff --git a/content/demo/index.md b/content/demo/index.md index 193fbb3..fe07ccd 100644 --- a/content/demo/index.md +++ b/content/demo/index.md @@ -505,7 +505,7 @@ With `range` type: ASCII ``` -The ASCII art are awesome! +The ASCII art is awesome! ### Aside (`