Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16e6ee4

Browse files
authored
Added dark theme selectors (#147)
1 parent e15bc85 commit 16e6ee4

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

sphinx_tabs/static/tabs.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,50 @@
5151
.sphinx-tab img {
5252
margin-bottom: 24 px;
5353
}
54+
55+
/* Dark theme preference styling */
56+
57+
@media (prefers-color-scheme: dark) {
58+
body:not([data-theme="light"]) .sphinx-tabs-panel {
59+
color: white;
60+
background-color: rgb(50, 50, 50);
61+
}
62+
63+
body:not([data-theme="light"]) .sphinx-tabs-tab {
64+
color: white;
65+
font-size: 16px;
66+
font-weight: 400;
67+
background-color: rgba(255, 255, 255, 0.05);
68+
}
69+
70+
body:not([data-theme="light"]) .sphinx-tabs-tab[aria-selected="true"] {
71+
font-weight: 700;
72+
border: 1px solid #a0b3bf;
73+
border-bottom: 1px solid rgb(50, 50, 50);
74+
margin: -1px;
75+
background-color: rgb(50, 50, 50);
76+
}
77+
}
78+
79+
/* Explicit dark theme styling */
80+
81+
body[data-theme="dark"] .sphinx-tabs-panel {
82+
color: white;
83+
background-color: rgb(50, 50, 50);
84+
}
85+
86+
body[data-theme="dark"] .sphinx-tabs-tab {
87+
color: white;
88+
font-size: 16px;
89+
font-weight: 400;
90+
border: 1px solid rgba(255, 255, 255, 0.15);
91+
background-color: rgba(255, 255, 255, 0.05);
92+
}
93+
94+
body[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] {
95+
font-weight: 700;
96+
border: 1px solid #a0b3bf;
97+
border-bottom: 2px solid rgb(50, 50, 50);
98+
margin: -1px;
99+
background-color: rgb(50, 50, 50);
100+
}

0 commit comments

Comments
 (0)