/
githubmirror
/
scikit-learn
Обзор
Документация
Войти
/
githubmirror
/
scikit-learn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
doc/js/scripts/theme-observer.js
23 строки
671 B
Matt J.
FIX Guess theme based on estimator parent node color (#32477)
17 окт 2025, 15:14
Не верифицирован
17 окт 2025, 15:14
c6b547c
Код
Авторство
О чём код?
(function () { const observer = new MutationObserver((mutationsList) => { for (const mutation of mutationsList) { if ( mutation.type === "attributes" && mutation.attributeName === "data-theme" ) { document .querySelectorAll(".sk-top-container") .forEach((estimatorElement) => { const newTheme = detectTheme(estimatorElement); estimatorElement.classList.remove("light", "dark"); estimatorElement.classList.add(newTheme); }); } } }); observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"], }); })();