Skip to content

Commit 246de77

Browse files
authored
fix(docs): fixed the color scheme (#2371)
* fix(docs): fixed the color scheme Signed-off-by: Hakeem Abbas <[email protected]> * fix(docs): colors background Signed-off-by: Hakeem Abbas <[email protected]> --------- Signed-off-by: Hakeem Abbas <[email protected]>
1 parent a975a79 commit 246de77

File tree

2 files changed

+59
-36
lines changed

2 files changed

+59
-36
lines changed

docs/stylesheets/extra.css

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,130 @@
11

2-
.md-header {
2+
/* Dark mode styles - only apply when Material theme is in dark mode (slate scheme) */
3+
[data-md-color-scheme="slate"] .md-header {
34
background-color: #02030C !important;
45
}
5-
.md-search__input {
6+
[data-md-color-scheme="slate"] .md-search__input {
67
background-color: rgba(22, 18, 48, 0.40) !important;
78
color: rgba(233, 219, 189, 0.90) !important;
89
}
9-
.md-search__input::placeholder {
10+
[data-md-color-scheme="slate"] .md-search__input::placeholder {
1011
color: rgba(233, 219, 189, 0.60) !important;
1112
opacity: 1;
1213
}
13-
.md-tabs {
14+
[data-md-color-scheme="slate"] .md-tabs {
1415
background-color: #02030C !important;
1516
}
16-
.md-ellipsis{
17+
[data-md-color-scheme="slate"] .md-ellipsis{
1718
color: rgba(233, 219, 189, 0.90) !important;
1819
}
19-
.md-footer {
20+
[data-md-color-scheme="slate"] .md-footer {
2021
background-color: #02030C !important;
2122
}
22-
.md-footer-meta{
23+
[data-md-color-scheme="slate"] .md-footer-meta{
2324
background-color: #02030C !important;
2425
}
2526
/* General Markdown background and text colors */
26-
body {
27-
background-color: #02030C;
27+
[data-md-color-scheme="slate"] body {
28+
background-color: #02030C !important;
2829
color: rgba(233, 219, 189, 0.90) !important;
2930
font-family: 'Arial', sans-serif;
3031
}
3132

33+
/* Main content area background */
34+
[data-md-color-scheme="slate"] .md-main {
35+
background-color: #02030C !important;
36+
}
37+
38+
[data-md-color-scheme="slate"] .md-content {
39+
background-color: #02030C !important;
40+
}
41+
42+
[data-md-color-scheme="slate"] .md-content__inner {
43+
background-color: #02030C !important;
44+
}
45+
46+
[data-md-color-scheme="slate"] .md-typeset {
47+
background-color: #02030C !important;
48+
color: rgba(233, 219, 189, 0.90) !important;
49+
}
50+
3251
/* Headings */
33-
h1, h2, h3, h4, h5, h6 {
52+
[data-md-color-scheme="slate"] h1,
53+
[data-md-color-scheme="slate"] h2,
54+
[data-md-color-scheme="slate"] h3,
55+
[data-md-color-scheme="slate"] h4,
56+
[data-md-color-scheme="slate"] h5,
57+
[data-md-color-scheme="slate"] h6 {
3458
color: rgba(233, 219, 189, 0.90) !important;
3559
}
3660

3761
/* Links */
38-
a {
62+
[data-md-color-scheme="slate"] a {
3963
color: rgba(233, 219, 189, 0.90) !important;
40-
4164
}
42-
a:hover {
65+
[data-md-color-scheme="slate"] a:hover {
4366
color: rgba(233, 219, 189, 0.90) !important;
4467
}
4568

4669
/* Code blocks */
47-
pre, code {
70+
[data-md-color-scheme="slate"] pre,
71+
[data-md-color-scheme="slate"] code {
4872
background-color: rgba(22, 18, 48, 0.40) !important;
4973
color: rgba(233, 219, 189, 0.90) !important;
5074
}
5175

5276
/* Blockquotes */
53-
blockquote {
77+
[data-md-color-scheme="slate"] blockquote {
5478
border-left: 4px solid rgba(233, 219, 189, 0.90);
5579
background-color: #02030C !important;
5680
color: rgba(233, 219, 189, 0.90) !important;
5781
}
5882

59-
6083
/* Tables */
61-
table {
84+
[data-md-color-scheme="slate"] table {
6285
background-color: rgba(22, 18, 48, 0.40) !important;
6386
color: rgba(233, 219, 189, 0.90) !important;
6487
}
65-
th, td {
88+
[data-md-color-scheme="slate"] th,
89+
[data-md-color-scheme="slate"] td {
6690
background-color: rgba(22, 18, 48, 0.40) !important;
6791
color: rgba(233, 219, 189, 0.90) !important;
6892
border: 1px solid rgba(210, 198, 172, 0.08) !important;
6993
}
7094
/* Horizontal rules */
71-
hr {
95+
[data-md-color-scheme="slate"] hr {
7296
background-color: rgba(22, 18, 48, 0.40) !important;
7397
}
74-
.md-search__icon.md-icon {
98+
[data-md-color-scheme="slate"] .md-search__icon.md-icon {
7599
color: rgba(233, 219, 189, 0.90) !important;
76100
}
77101

78-
.md-search__icon.md-icon:hover {
102+
[data-md-color-scheme="slate"] .md-search__icon.md-icon:hover {
79103
color: rgba(233, 219, 189, 0.90) !important;
80104
}
81-
.card {
105+
[data-md-color-scheme="slate"] .card {
82106
background-color: rgba(22, 18, 48, 0.40) !important;
83107
border: 1px solid rgba(210, 198, 172, 0.08) !important;
84108
}
85109

86-
details {
110+
[data-md-color-scheme="slate"] details {
87111
border: 1.65px solid rgba(210, 198, 172, 0.08) !important;
88112
background-color: rgba(22, 18, 48, 0.40) !important;
89113
color: rgba(233, 219, 189, 0.90) !important;
90114
}
91-
summary {
115+
[data-md-color-scheme="slate"] summary {
92116
background-color: rgba(22, 18, 48, 0.40) !important;
93117
color: rgba(233, 219, 189, 0.90) !important;
94118
}
95-
.md-header__button {
119+
[data-md-color-scheme="slate"] .md-header__button {
96120
color: rgba(233, 219, 189, 0.90) !important;
97121
}
98-
.md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
122+
[data-md-color-scheme="slate"] .md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
99123
background: none !important;
100124
box-shadow: none !important;
101125
}
102-
.md-nav--secondary .md-nav__title {
103-
background: none !important;
126+
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__title {
127+
background: #02030C !important;
104128
box-shadow: none !important;
105129
color: rgba(233, 219, 189, 0.90) !important;
106130
}

mkdocs.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@ theme:
77
name: material
88
custom_dir: docs/overrides
99
palette:
10-
# Palette toggle for automatic mode
11-
- media: "(prefers-color-scheme)"
12-
scheme: default
10+
# Default dark mode
11+
- scheme: slate
1312
primary: black
1413
toggle:
15-
icon: material/brightness-auto
14+
icon: material/brightness-7
1615
name: Switch to light mode
1716

18-
# Palette toggle for light mode
17+
# Light mode
1918
- media: "(prefers-color-scheme: light)"
2019
scheme: default
2120
primary: black
2221
toggle:
23-
icon: material/brightness-7
22+
icon: material/brightness-4
2423
name: Switch to dark mode
2524

26-
# Palette toggle for dark mode
25+
# System preference (dark)
2726
- media: "(prefers-color-scheme: dark)"
2827
scheme: slate
2928
primary: black
3029
toggle:
31-
icon: material/brightness-4
30+
icon: material/brightness-auto
3231
name: Switch to system preference
3332

3433
logo: assets/logo.png

0 commit comments

Comments
 (0)