feat: add monospace style

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

View file

@ -9,6 +9,7 @@
* [jira](./jira.user.css)
* [lists-fedoraproject](./lists-fedoraproject.user.css)
* [mikrotik](./mikrotik.user.css)
* [monospace](./monospace.user.css)
* [notion](./notion.user.css)
* [pagure](./pagure.user.css)
* [sourcehut](./sourcehut.user.css)

317
monospace.user.css Normal file
View file

@ -0,0 +1,317 @@
/* ==UserStyle==
@name default monospace
@namespace git.mfocko.xyz/mfocko/usercss
@updateURL https://git.mfocko.xyz/mfocko/usercss/raw/branch/main/monospace.user.css
@version 1.15.10
@description Replace default monospace font on majority of websites.
@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 text font-features "Font feature settings" "'calt' on, 'liga' on, 'dlig' on"
@var text blog-weight "Blog weight of monospace" 350
==/UserStyle== */
if monospace-font == "custom"
monospace-font = custom-font
@-moz-document domain("codewars.com"),
domain("kurzy.kpi.fei.tuke.sk"),
regexp("https://(www\\.)fi\\.muni\\.cz/pb071/.*"),
regexp(".*fi\\.muni\\.cz/~xfocko/.*"),
domain("softwarefactory-project.io"),
domain("stackoverflow.com"),
domain("docs.oracle.com"),
domain("docs.rs"),
domain("livebook.manning.com"),
domain("adventofcode.com"),
domain("wiki.gentoo.org"),
domain("is.muni.cz"),
domain("codeforces.com"),
domain("leetcode.com"),
domain("hackerrank.com"),
domain("en.cppreference.com"),
domain("sentry.io"),
domain("docs.microsoft.com"),
domain("packit.dev"),
regexp("https://.*\\.fedoraproject.org/.*"),
regexp("https://(.*)\\.github\\.io/.*"),
domain("cppquiz.org"),
domain("sprunge.us"),
domain("blog.mfocko.xyz"),
domain("inet.muni.cz"),
domain("localhost"),
domain("me.mfocko.xyz"),
domain("app.slack.com"),
domain("learn.microsoft.com"),
domain("peps.python.org"),
domain("ix.io"),
domain("app.element.io"),
domain("chat.osci.redhat.com"),
domain("exercism.org"),
domain("root.cz"),
domain("asciinema.org"),
domain("reddit.com"),
domain("role.rhu.redhat.com"),
domain("forum.mikrotik.com"),
url-prefix("https://ziglang.org/documentation/"),
domain("medium.com"),
domain("discord.com"),
domain("open-std.org"),
domain("docs.swift.org"),
domain("go.dev"),
domain("matrix.fi.muni.cz"),
domain("chat.almalinux.org"),
domain("natureofcode.com") {
pre,
code,
kbd,
var,
samp,
tt,
textarea,
text {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("codewars.com") {
.CodeMirror,
.result-type--result,
.result-type--log .result-type__value {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document regexp(".*fi\\.muni\\.cz/~kontr/logs/.*") {
* {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("en.cppreference.com") {
.mw-geshi,
.t-lc,
#wpTextbox1,
.t-dsc-member-div > div:nth-child(1) {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("hackerrank.com") {
*[ style *='monospace'] {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("play.rust-lang.org") {
.ace_editor,
div#output-stdout,
div#output-stderr {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("docs.oracle.com") {
.contentContainer .description dl dd,
.contentContainer .details dl dd,
.serializedFormContainer dl dd {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("lounge.mfocko.xyz"),
domain("lounge.fi.muni.cz") {
body,
code,
pre,
#chat .msg[data-type="monospace_block"] .text,
.irc-monospace,
textarea#user-specified-css-input {
font-family: monospace-font;
font-feature-settings: font-features;
}
.messages .msg {
font-weight: normal;
}
}
@-moz-document domain("adventofcode.com") {
body {
font-family: monospace-font;
font-feature-settings: font-features;
transform-origin: center;
transform: translateX(calc((100% - 45em) / 2));
/*
margin-left: 45em;
margin-right: 45em;
*/
}
}
@-moz-document domain("leetcode.com") {
.view-lines,
.margin-view-overlays,
.font-menlo,
.message,
.CodeMirror {
font-family: monospace-font !important;
font-feature-settings: font-features !important;
}
}
@-moz-document domain("sentry.io") {
.traceback ol.context > li,
.css-w0gxse .e1qdl66w1,
.css-1igmgpv .e1qdl66w1,
code[class*=language-], pre[class*=language-] {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("app.element.io"),
domain("chat.osci.redhat.com"),
domain("matrix.fi.muni.cz") {
*,
.mx_EventTile_content .markdown-body,
.mx_EventTile_content .markdown-body code,
.mx_EventTile_content .markdown-body pre {
font-family: monospace-font !important;
font-feature-settings: font-features !important;
}
}
@-moz-document domain("overleaf.com") {
.ace_editor {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document regexp(".*fi\\.muni\\.cz/~xfocko/.*") {
* {
font-feature-settings: font-features;
}
}
@-moz-document domain("mail.google.com") {
.a3s {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("codeforces.com") {
.ace_editor,
.problem-statement .sample-tests {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("exercism.org") {
.c-code-pane code li {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("doc.rust-lang.org") {
pre, code, a.test-arrow, .code-header {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("medium.com") {
.qe {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("localhost"),
domain("blog.mfocko.xyz") {
[data-theme=dark] code,
[data-theme=dark] kbd,
[data-theme=dark] pre,
[data-theme=dark] text,
[data-theme=dark] tt,
[data-theme=dark] var {
font-weight: blog-weight;
}
}
@-moz-document domain("learn.microsoft.com") {
.parameterName, dl.parameterList dt {
font-family: monospace-font !important;
}
}
@-moz-document domain("bugzilla.redhat.com") {
textarea,
.bz_comment_text,
.uneditable_textarea,
tbody.file pre,
pre.field_textarea_readonly {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("dashboard.packit.dev"),
domain("dashboard.stg.packit.dev") {
.pf-v5-c-log-viewer__index,
.pf-v5-c-log-viewer__list {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("app.slack.com") {
pre > div,
code > div {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}
@-moz-document domain("mail.proton.me") {
.proton-plain-text {
font-family: monospace-font !important;
font-feature-settings: font-features;
}
}