You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

custom.js 756 B

123456789101112131415161718192021222324252627
  1. const fixColorContrast = (selector, color) => {
  2. const elements = document.querySelectorAll(selector);
  3. if (elements.length > 0) {
  4. elements.forEach(element => {
  5. element.style.color = color;
  6. });
  7. }
  8. }
  9. const observer = new MutationObserver(() => {
  10. const hashLinks = document.querySelectorAll('.hash-link[title="Direct link to heading"]');
  11. if (hashLinks.length > 0) {
  12. hashLinks.forEach(link => {
  13. link.setAttribute('tabindex', '-1');
  14. });
  15. }
  16. fixColorContrast('.token.comment', '#8a93c8')
  17. fixColorContrast('.token.boolean', '#ff5c79')
  18. fixColorContrast('blockquote a', '#0d55b4')
  19. fixColorContrast('.ant-select-selection-placeholder', '#747474')
  20. });
  21. observer.observe(document, {
  22. childList: true,
  23. subtree: true
  24. });