diff --git a/content/styles/fonts.css b/content/styles/fonts.css new file mode 100644 index 0000000..45d68c6 --- /dev/null +++ b/content/styles/fonts.css @@ -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; +} diff --git a/manifest.json b/manifest.json index 44b93b0..f5530e3 100644 --- a/manifest.json +++ b/manifest.json @@ -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",