feat: add fonts CSS with @font-face and override rules

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-27 05:43:46 -04:00
parent d7094495d3
commit 4856520c38
2 changed files with 55 additions and 2 deletions

53
content/styles/fonts.css Normal file
View File

@@ -0,0 +1,53 @@
/* --- @font-face declarations --- */
@font-face {
font-family: 'Reddit Sans';
src: url("../fonts/RedditSans[wght].woff2") format("woff2");
font-weight: 300 800;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Reddit Sans Condensed';
src: url("../fonts/RedditSansCondensed[wght].woff2") format("woff2");
font-weight: 300 800;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Reddit Mono';
src: url("../fonts/RedditMono[wght].woff2") format("woff2");
font-weight: 300 800;
font-style: normal;
font-display: swap;
}
/* --- Font overrides (gated on toggle class) --- */
html.rt-fonts-enabled,
html.rt-fonts-enabled body,
html.rt-fonts-enabled input,
html.rt-fonts-enabled textarea,
html.rt-fonts-enabled select,
html.rt-fonts-enabled button {
font-family: 'Reddit Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
html.rt-fonts-enabled .content,
html.rt-fonts-enabled .side,
html.rt-fonts-enabled .footer-parent,
html.rt-fonts-enabled .nav-buttons,
html.rt-fonts-enabled .tabmenu,
html.rt-fonts-enabled .morelink,
html.rt-fonts-enabled .titlebox,
html.rt-fonts-enabled .searchpane,
html.rt-fonts-enabled .infobar {
font-family: inherit !important;
}
html.rt-fonts-enabled code,
html.rt-fonts-enabled pre,
html.rt-fonts-enabled .md code,
html.rt-fonts-enabled .md pre {
font-family: 'Reddit Mono', 'SF Mono', 'Fira Code', Consolas, monospace !important;
}

View File

@@ -15,8 +15,8 @@
},
"content_scripts": [
{
"matches": ["*://old.reddit.com/*"],
"css": ["content/styles/badges.css", "content/styles/cards.css"],
"matches": ["*://old.reddit.com/*", "*://www.reddit.com/*"],
"css": ["content/styles/badges.css", "content/styles/cards.css", "content/styles/fonts.css"],
"js": [
"lib/settings.js",
"content/tweaks/badges.js",