diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index 4183388f..8dd7649c 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -54,6 +54,9 @@ const getFontStyles = ( --serif: ${serifFonts.map((font) => `"${font}"`).join(', ')}, serif; --sans-serif: ${sansSerifFonts.map((font) => `"${font}"`).join(', ')}, sans-serif; --monospace: ${monospaceFonts.map((font) => `"${font}"`).join(', ')}, monospace; + --font-size: ${fontSize}px; + --min-font-size: ${minFontSize}px; + --font-weight: ${fontWeight}; } html, body { font-size: ${fontSize}px !important; @@ -549,6 +552,7 @@ export const transformStylesheet = (vw: number, vh: number, css: string) => { .replace(/(\d*\.?\d+)vw/gi, (_, d) => (parseFloat(d) * vw) / 100 + 'px') .replace(/(\d*\.?\d+)vh/gi, (_, d) => (parseFloat(d) * vh) / 100 + 'px') .replace(/([\s;])font-family\s*:\s*monospace/gi, '$1font-family: var(--monospace)') + .replace(/([\s;])font-weight\s*:\s*normal/gi, '$1font-weight: var(--font-weight)') .replace(/([\s;])color\s*:\s*black/gi, '$1color: var(--theme-fg-color)') .replace(/([\s;])color\s*:\s*#000000/gi, '$1color: var(--theme-fg-color)') .replace(/([\s;])color\s*:\s*#000/gi, '$1color: var(--theme-fg-color)')