mirror of
https://github.com/microsoft/autogen.git
synced 2025-08-12 18:51:33 +00:00
28 lines
756 B
JavaScript
28 lines
756 B
JavaScript
![]() |
const fixColorContrast = (selector, color) => {
|
||
|
const elements = document.querySelectorAll(selector);
|
||
|
if (elements.length > 0) {
|
||
|
elements.forEach(element => {
|
||
|
element.style.color = color;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const observer = new MutationObserver(() => {
|
||
|
const hashLinks = document.querySelectorAll('.hash-link[title="Direct link to heading"]');
|
||
|
if (hashLinks.length > 0) {
|
||
|
hashLinks.forEach(link => {
|
||
|
link.setAttribute('tabindex', '-1');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
fixColorContrast('.token.comment', '#8a93c8')
|
||
|
fixColorContrast('.token.boolean', '#ff5c79')
|
||
|
fixColorContrast('blockquote a', '#0d55b4')
|
||
|
fixColorContrast('.ant-select-selection-placeholder', '#747474')
|
||
|
});
|
||
|
|
||
|
observer.observe(document, {
|
||
|
childList: true,
|
||
|
subtree: true
|
||
|
});
|