fix(css): only override background color of hr when it has background image (#2808)

This commit is contained in:
Huang Xin
2025-12-30 10:24:37 +01:00
committed by GitHub
parent d53fc09e1e
commit 58a5c1625c
+7 -1
View File
@@ -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) => {