diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index 4e4ee1f2..f50d03b7 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -155,7 +155,7 @@ const getColorStyles = ( ${!isDarkMode && overrideColor ? 'mix-blend-mode: multiply;' : ''} } /* horizontal rule #1649 */ - *:has(> hr[class]):not(body) { + *:has(> hr.background-img):not(body) { background-color: ${bg}; } hr { @@ -759,6 +759,12 @@ export const applyImageStyle = (document: Document) => { img.classList.add('has-text-siblings'); } }); + document.querySelectorAll('hr').forEach((hr) => { + const computedStyle = window.getComputedStyle(hr); + if (computedStyle.backgroundImage && computedStyle.backgroundImage !== 'none') { + hr.classList.add('background-img'); + } + }); }; export const applyTableStyle = (document: Document) => {