usercss/forgejo.user.css

95 lines
2.8 KiB
CSS
Raw Normal View History

/* ==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.8
@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,
.markdown-text-editor {
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;
}
}