From 4d958d90e54241b1a5728dd3eee75708a294b764569611c32f0a3ceb6a535e97 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Mon, 5 Aug 2024 18:40:09 +0200 Subject: [PATCH] feat: add forgejo style Signed-off-by: Matej Focko --- README.md | 1 + forgejo.user.css | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 forgejo.user.css diff --git a/README.md b/README.md index 760b7bd..6ad30e1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ## List of available styles +* [forgejo](./forgejo.user.css) * [github](./github.user.css) * [gitlab](./gitlab.user.css) * [ismu](./ismu.user.css) diff --git a/forgejo.user.css b/forgejo.user.css new file mode 100644 index 0000000..fd6fd30 --- /dev/null +++ b/forgejo.user.css @@ -0,0 +1,93 @@ +/* ==UserStyle== +@name Forgejo / Gitea +@namespace git.mfocko.xyz/mfocko/usercss +@updateURL https://git.mfocko.xyz/mfocko/usercss/raw/branch/main/forgejo.user.css +@version 1.6.7 +@description Switch monospace font and allow to hide diff highlight. +@author mfocko +@preprocessor stylus +@var select monospace-font "Font" [ + "custom*", + "Berkeley Mono Variable", + "Cascadia Code NF", + "Comic Code Ligatures", + "Fira Code", + "Hack", + "IBM Plex Mono", + "Iosevka Term", + "Iosevka Term Slab", + "Iosevka Comfy", + "Pragmasevka", + "JetBrains Mono", + "JuliaMono", + "MonoLisa Variable", + "PragmataPro Liga", + "PragmataPro Mono Liga", + "Rec Mono Linear", + "Roboto Mono", + "SF Mono", + "Source Code Pro", + "Victor Mono", +] +@var text custom-font "Custom font" "monospace" +@var checkbox diff-highlight "Show diff highlighting" 1 +@var text font-features "Font feature settings" "'calt' on, 'liga' on, 'dlig' on" +@var checkbox monospace-comments "Render comments in monospace font" 0 +@var checkbox all-the-way "Render everything in monospace font" 0 +==/UserStyle== */ + +if monospace-font=="custom" + monospace-font=custom-font + +@-moz-document domain("git.mfocko.xyz"), +domain("git.almalinux.org"), +domain("codeberg.org"), +domain("next.forgejo.org") { + * { + --fonts-monospace: monospace-font !important; + font-feature-settings: font-features; + } + + if monospace-comments { + .comment-content, + .comment-body { + font-family: monospace-font !important; + font-feature-settings: font-features; + } + } + + .code-diff-split .del-code .lines-code-old, + .code-diff-split .del-code .lines-num-old, + .code-diff-split .del-code .lines-type-marker-old, + .code-diff-unified .del-code, + .code-diff-unified .del-code td, + .code-diff-split .add-code .lines-code-new, + .code-diff-split .add-code .lines-num-new, + .code-diff-split .add-code .lines-type-marker-new, + .code-diff-split .del-code .add-code.lines-code-new, + .code-diff-split .del-code .add-code.lines-num-new, + .code-diff-split .del-code .add-code.lines-type-marker-new, + .code-diff-unified .add-code, + .code-diff-unified .add-code td { + if !diff-highlight { + background: none; + } + } + + if all-the-way { + * { + font-family: monospace-font !important; + font-feature-settings: font-features; + } + } +} + +@-moz-document regexp("^https://.*git\\.mfocko\\.xyz.*\\.(patch|diff)$"), +regexp("^https://.*git\\.almalinux\\.org.*\\.(patch|diff)$"), +regexp("^https://.*codeberg\\.org.*\\.(patch|diff)$"), +regexp("^https://.*next\\.forgejo\\.org.*\\.(patch|diff)$"){ + * { + font-family: monospace-font !important; + font-feature-settings: font-features; + } +}