feat: add forgejo style

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2024-08-05 18:40:09 +02:00
parent 9bd8f4c18a
commit 4d958d90e5
Signed by: mfocko
SSH key fingerprint: SHA256:icm0fIOSJUpy5+1x23sfr+hLtF9UhY8VpMC7H4WFJP8
2 changed files with 94 additions and 0 deletions

View file

@ -2,6 +2,7 @@
## List of available styles
* [forgejo](./forgejo.user.css)
* [github](./github.user.css)
* [gitlab](./gitlab.user.css)
* [ismu](./ismu.user.css)

93
forgejo.user.css Normal file
View file

@ -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 <me@mfocko.xyz>
@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;
}
}