From 7915f63094d728654cfc9efd1d90fda479c285a5 Mon Sep 17 00:00:00 2001 From: Robin De Schepper Date: Wed, 16 Feb 2022 12:47:22 +0100 Subject: [PATCH] Added dark theme selectors --- sphinx_tabs/static/tabs.css | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/sphinx_tabs/static/tabs.css b/sphinx_tabs/static/tabs.css index c74e895..02eaeb4 100644 --- a/sphinx_tabs/static/tabs.css +++ b/sphinx_tabs/static/tabs.css @@ -51,3 +51,50 @@ .sphinx-tab img { margin-bottom: 24 px; } + +/* Dark theme preference styling */ + +@media (prefers-color-scheme: dark) { + body:not([data-theme="light"]) .sphinx-tabs-panel { + color: white; + background-color: rgb(50, 50, 50); + } + + body:not([data-theme="light"]) .sphinx-tabs-tab { + color: white; + font-size: 16px; + font-weight: 400; + background-color: rgba(255, 255, 255, 0.05); + } + + body:not([data-theme="light"]) .sphinx-tabs-tab[aria-selected="true"] { + font-weight: 700; + border: 1px solid #a0b3bf; + border-bottom: 1px solid rgb(50, 50, 50); + margin: -1px; + background-color: rgb(50, 50, 50); + } +} + +/* Explicit dark theme styling */ + +body[data-theme="dark"] .sphinx-tabs-panel { + color: white; + background-color: rgb(50, 50, 50); +} + +body[data-theme="dark"] .sphinx-tabs-tab { + color: white; + font-size: 16px; + font-weight: 400; + border: 1px solid rgba(255, 255, 255, 0.15); + background-color: rgba(255, 255, 255, 0.05); +} + +body[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] { + font-weight: 700; + border: 1px solid #a0b3bf; + border-bottom: 2px solid rgb(50, 50, 50); + margin: -1px; + background-color: rgb(50, 50, 50); +}