forked from akai/readest
fix(style): let background texture take precedence over overridden background color (#3761)
When a background texture is active, skip applying the overridden bg/fg/border colors on block elements so the texture stays visible instead of being painted over.
This commit is contained in:
@@ -128,6 +128,7 @@ const getColorStyles = (
|
||||
isEink: boolean,
|
||||
) => {
|
||||
const { bg, fg, primary, isDarkMode } = themeCode;
|
||||
const hasBackgroundTexture = !!backgroundTextureId && backgroundTextureId !== 'none';
|
||||
const colorStyles = `
|
||||
html {
|
||||
--bg-texture-id: ${backgroundTextureId};
|
||||
@@ -153,9 +154,9 @@ const getColorStyles = (
|
||||
}
|
||||
section, aside, blockquote, article, nav, header, footer, main, figure,
|
||||
div, p, font, h1, h2, h3, h4, h5, h6, li, span {
|
||||
${overrideColor ? `background-color: ${bg} !important;` : ''}
|
||||
${overrideColor ? `color: ${fg} !important;` : ''}
|
||||
${overrideColor ? `border-color: ${fg} !important;` : ''}
|
||||
${overrideColor && !hasBackgroundTexture ? `background-color: ${bg} !important;` : ''}
|
||||
${overrideColor && !hasBackgroundTexture ? `color: ${fg} !important;` : ''}
|
||||
${overrideColor && !hasBackgroundTexture ? `border-color: ${fg} !important;` : ''}
|
||||
}
|
||||
pre, span { /* inline code blocks */
|
||||
${overrideColor ? `background-color: ${bg} !important;` : ''}
|
||||
|
||||
Reference in New Issue
Block a user