From 6118c0ddec856249c75e4fe3ac4f7349b7e4d511 Mon Sep 17 00:00:00 2001 From: Ariel Rin Date: Wed, 1 Nov 2023 01:10:39 +1000 Subject: [PATCH] override non compatible dark mode check css --- docs/_static/css/tabs.css | 72 +++++++++++++++++++++++++++++++++++++++ docs/conf.py | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 docs/_static/css/tabs.css diff --git a/docs/_static/css/tabs.css b/docs/_static/css/tabs.css new file mode 100644 index 00000000..72573c81 --- /dev/null +++ b/docs/_static/css/tabs.css @@ -0,0 +1,72 @@ +.sphinx-tabs { + margin-bottom: 1rem; +} + +[role="tablist"] { + border-bottom: 1px solid #a0b3bf; +} + +.sphinx-tabs-tab { + position: relative; + font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif; + color: #1D5C87; + line-height: 24px; + margin: 0; + font-size: 16px; + font-weight: 400; + background-color: rgba(255, 255, 255, 0); + border-radius: 5px 5px 0 0; + border: 0; + padding: 1rem 1.5rem; + margin-bottom: 0; +} + +.sphinx-tabs-tab[aria-selected="true"] { + font-weight: 700; + border: 1px solid #a0b3bf; + border-bottom: 1px solid white; + margin: -1px; + background-color: white; +} + +.sphinx-tabs-tab:focus { + z-index: 1; + outline-offset: 1px; +} + +.sphinx-tabs-panel { + position: relative; + padding: 1rem; + border: 1px solid #a0b3bf; + margin: 0px -1px -1px -1px; + border-radius: 0 0 5px 5px; + border-top: 0; + background: white; +} + +.sphinx-tabs-panel.code-tab { + padding: 0.4rem; +} + +.sphinx-tab img { + margin-bottom: 24 px; +} + +/* Dark theme preference styling */ + +@media (prefers-color-scheme: dark) { + .sphinx-tabs-panel { + color: white; + background-color: rgb(50, 50, 50); + } + + .sphinx-tabs-tab { + color: white; + background-color: rgba(255, 255, 255, 0.05); + } + + .sphinx-tabs-tab[aria-selected="true"] { + border-bottom: 1px solid rgb(50, 50, 50); + background-color: rgb(50, 50, 50); + } +} diff --git a/docs/conf.py b/docs/conf.py index 90e05262..78f8c63b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -82,7 +82,7 @@ html_theme = 'sphinx_rtd_theme' # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -html_css_files = ["css/rtd_dark.css"] +html_css_files = ["css/rtd_dark.css", "css/tabs.css"] # -- Options for HTMLHelp output ------------------------------------------