aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/config.js9
-rw-r--r--src/modules/interface.js40
2 files changed, 47 insertions, 2 deletions
diff --git a/src/modules/config.js b/src/modules/config.js
index e54a883c..88e339cf 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -52,7 +52,13 @@ export const defaultState = {
palette: null, // not used yet, will be used for V3
theme3hacks: { // Hacks, user overrides that are independent of theme used
underlay: 'none',
- badgeColor: null
+ badgeColor: null,
+ fonts: {
+ interface: undefined,
+ input: undefined,
+ post: undefined,
+ monospace: undefined
+ }
},
hideISP: false,
@@ -147,7 +153,6 @@ export const defaultState = {
navbarSize: undefined, // instance default
panelHeaderSize: undefined, // instance default
forcedRoundness: undefined, // instance default
- fontsOverride: undefined, // instance default
navbarColumnStretch: false,
greentext: undefined, // instance default
useAtIcon: undefined, // instance default
diff --git a/src/modules/interface.js b/src/modules/interface.js
index 38ee88db..206c68a7 100644
--- a/src/modules/interface.js
+++ b/src/modules/interface.js
@@ -274,6 +274,46 @@ const interfaceMod = {
Object.entries(theme3hacks).forEach(([key, value]) => {
switch (key) {
+ case 'fonts': {
+ Object.entries(theme3hacks.fonts).forEach(([fontKey, font]) => {
+ if (!font?.family) return
+ switch (fontKey) {
+ case 'interface':
+ hacks.push({
+ component: 'Root',
+ directives: {
+ '--font': 'generic | ' + font.family
+ }
+ })
+ break
+ case 'input':
+ hacks.push({
+ component: 'Input',
+ directives: {
+ '--font': 'generic | ' + font.family
+ }
+ })
+ break
+ case 'post':
+ hacks.push({
+ component: 'RichContent',
+ directives: {
+ '--font': 'generic | ' + font.family
+ }
+ })
+ break
+ case 'monospace':
+ hacks.push({
+ component: 'Root',
+ directives: {
+ '--monoFont': 'generic | ' + font.family
+ }
+ })
+ break
+ }
+ })
+ break
+ }
case 'underlay': {
if (value !== 'none') {
const newRule = {