From cb80effe4420d9379e7fe4553c1e9a29c2448078 Mon Sep 17 00:00:00 2001 From: jthielen Date: Fri, 9 Sep 2022 11:15:32 -0600 Subject: [PATCH] Remove dark-theme hack given upstream fix --- ci/environment-docs.yml | 2 +- docs/source/_static/custom.js | 30 ------------------------------ docs/source/conf.py | 1 - 3 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 docs/source/_static/custom.js diff --git a/ci/environment-docs.yml b/ci/environment-docs.yml index ee390e72..cf96e94f 100644 --- a/ci/environment-docs.yml +++ b/ci/environment-docs.yml @@ -20,7 +20,7 @@ dependencies: - sphinx-comments - sphinx-copybutton - sphinx-design - - xarray>=0.18,!=0.20.0,!=0.20.1 + - xarray>=2022.06.0 - xgcm - pip: - sphinxext-opengraph diff --git a/docs/source/_static/custom.js b/docs/source/_static/custom.js deleted file mode 100644 index 13a49111..00000000 --- a/docs/source/_static/custom.js +++ /dev/null @@ -1,30 +0,0 @@ -console.log('RUNNING CUSTOM JAVASCRIPT') - -function getBodyThemeName() { - var bodyTheme = document.body.dataset.theme - const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches - - if (bodyTheme === 'auto') { - if (prefersDark) { - bodyTheme = 'dark' - } else { - bodyTheme = 'light' - } - } - - return bodyTheme -} - -document.documentElement.setAttribute('theme', getBodyThemeName()) - -var observer = new MutationObserver(function (mutations) { - mutations.forEach(function (mutation) { - if (mutation.type == 'attributes') { - var bodyTheme = getBodyThemeName() - console.log('document.body.dataset.theme changed to ' + bodyTheme) - document.documentElement.setAttribute('theme', bodyTheme) - } - }) -}) - -observer.observe(document.body, { attributeFilter: ['data-theme'] }) diff --git a/docs/source/conf.py b/docs/source/conf.py index c8db55d7..dd7357b9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -96,7 +96,6 @@ 'doc_path': 'docs', } html_static_path = ['_static'] -html_js_files = ['custom.js'] html_theme_options = dict( # analytics_id='' this is configured in rtfd.io # canonical_url="",