mirror of
https://github.com/microsoft/autogen.git
synced 2025-08-10 01:32:03 +00:00

* fix light theme accessibility * fix dark theme * fix format * Fix formatting --------- Co-authored-by: Davor Runje <davor@airt.ai> Co-authored-by: Chi Wang <wang.chi@microsoft.com>
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
|
|
});
|