fix(SelectionAssistant): customCSS should not override background (#6746)

fix: customCSS should not override background
This commit is contained in:
fullex 2025-06-04 17:11:31 +08:00 committed by GitHub
parent 8998bbff27
commit 242ea279ee

View File

@ -157,9 +157,11 @@ const SelectionToolbar: FC<{ demo?: boolean }> = ({ demo = false }) => {
}
if (customCss) {
const newCustomCss = customCss.replace(/background(-image|-color)?\s*:[^;]+;/gi, '')
customCssElement = document.createElement('style')
customCssElement.id = 'user-defined-custom-css'
customCssElement.textContent = customCss
customCssElement.textContent = newCustomCss
document.head.appendChild(customCssElement)
}
}, [customCss])