Skip to content

Commit d0e68d0

Browse files
authored
docs(style): add theme switching to the document website (#221)
* feat: add theme switching to the document website Signed-off-by: yuluo-yx <[email protected]> * remove theme btn Signed-off-by: yuluo-yx <[email protected]> * fix: fix mobile sidecar Signed-off-by: yuluo-yx <[email protected]> --------- Signed-off-by: yuluo-yx <[email protected]>
1 parent f4d6d71 commit d0e68d0

File tree

5 files changed

+644
-31
lines changed

5 files changed

+644
-31
lines changed

website/docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ const config = {
207207
prism: {
208208
theme: lightCodeTheme,
209209
darkTheme: darkCodeTheme,
210-
additionalLanguages: ['bash', 'json', 'yaml', 'go', 'rust'],
210+
additionalLanguages: ['bash', 'json', 'yaml', 'go', 'rust', 'python'],
211211
},
212212
colorMode: {
213213
defaultMode: 'light',
214-
disableSwitch: true,
215-
respectPrefersColorScheme: false,
214+
disableSwitch: false,
215+
respectPrefersColorScheme: true,
216216
},
217217
}),
218218
}

website/src/components/AcknowledgementsSection/index.module.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
background: linear-gradient(135deg, #F6F8FA 0%, #FFFFFF 50%, #F0F3F6 100%);
55
position: relative;
66
overflow: hidden;
7+
transition: all 0.3s ease;
8+
}
9+
10+
/* Dark theme acknowledgements section */
11+
[data-theme='dark'] .acknowledgementsSection {
12+
background: linear-gradient(135deg, #161B22 0%, #21262D 50%, #161B22 100%);
713
}
814

915
.acknowledgementsSection::before {
@@ -19,6 +25,15 @@
1925
radial-gradient(circle at 50% 50%, rgba(130, 80, 223, 0.03) 0%, transparent 50%);
2026
pointer-events: none;
2127
animation: acknowledgementsBackgroundFlow 15s ease-in-out infinite;
28+
transition: all 0.3s ease;
29+
}
30+
31+
/* Dark theme acknowledgements background */
32+
[data-theme='dark'] .acknowledgementsSection::before {
33+
background-image:
34+
radial-gradient(circle at 25% 25%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
35+
radial-gradient(circle at 75% 75%, rgba(253, 181, 22, 0.08) 0%, transparent 50%),
36+
radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
2237
}
2338

2439
.acknowledgementsContainer {
@@ -39,6 +54,15 @@
3954
-webkit-text-fill-color: transparent;
4055
background-clip: text;
4156
animation: acknowledgementsTitleGlow 4s ease-in-out infinite;
57+
transition: all 0.3s ease;
58+
}
59+
60+
/* Dark theme title */
61+
[data-theme='dark'] .acknowledgementsTitle {
62+
background: linear-gradient(135deg, #58A6FF, #FDB516, #A855F7);
63+
-webkit-background-clip: text;
64+
-webkit-text-fill-color: transparent;
65+
background-clip: text;
4266
}
4367

4468
.acknowledgementsSubtitle {
@@ -49,6 +73,12 @@
4973
max-width: 800px;
5074
margin-left: auto;
5175
margin-right: auto;
76+
transition: color 0.3s ease;
77+
}
78+
79+
/* Dark theme subtitle */
80+
[data-theme='dark'] .acknowledgementsSubtitle {
81+
color: #8B949E;
5282
}
5383

5484
.projectsGrid {
@@ -73,6 +103,13 @@
73103
color: inherit;
74104
}
75105

106+
/* Dark theme project card */
107+
[data-theme='dark'] .projectCard {
108+
background: rgba(33, 38, 45, 0.8);
109+
border-color: rgba(88, 166, 255, 0.3);
110+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
111+
}
112+
76113
.projectCard:hover {
77114
background: rgba(255, 255, 255, 0.95);
78115
border-color: rgba(88, 166, 255, 0.4);
@@ -82,6 +119,13 @@
82119
color: inherit;
83120
}
84121

122+
/* Dark theme project card hover */
123+
[data-theme='dark'] .projectCard:hover {
124+
background: rgba(33, 38, 45, 0.95);
125+
border-color: rgba(88, 166, 255, 0.5);
126+
box-shadow: 0 8px 32px rgba(88, 166, 255, 0.2);
127+
}
128+
85129
.projectLogoWrapper {
86130
width: 80px;
87131
height: 80px;
@@ -92,6 +136,13 @@
92136
border-radius: 12px;
93137
background: rgba(255, 255, 255, 0.9);
94138
box-shadow: 0 2px 8px rgba(9, 105, 218, 0.1);
139+
transition: all 0.3s ease;
140+
}
141+
142+
/* Dark theme logo wrapper */
143+
[data-theme='dark'] .projectLogoWrapper {
144+
background: rgba(48, 54, 61, 0.9);
145+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
95146
}
96147

97148
.projectLogo {
@@ -113,6 +164,12 @@
113164
color: #1F2328;
114165
text-align: center;
115166
line-height: 1.4;
167+
transition: color 0.3s ease;
168+
}
169+
170+
/* Dark theme project name */
171+
[data-theme='dark'] .projectName {
172+
color: #F0F6FC;
116173
}
117174

118175
/* Animations */

website/src/components/HomepageFeatures/styles.module.css

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
backdrop-filter: blur(10px);
99
position: relative;
1010
overflow: hidden;
11+
transition: all 0.3s ease;
12+
}
13+
14+
/* Dark theme features section */
15+
[data-theme='dark'] .features {
16+
background: linear-gradient(135deg, #161B22 0%, #21262D 50%, #161B22 100%);
1117
}
1218

1319
.features::before {
@@ -22,6 +28,14 @@
2228
radial-gradient(circle at 75% 75%, rgba(253, 181, 22, 0.05) 0%, transparent 50%);
2329
pointer-events: none;
2430
animation: featuresBackgroundFlow 10s ease-in-out infinite;
31+
transition: all 0.3s ease;
32+
}
33+
34+
/* Dark theme features background */
35+
[data-theme='dark'] .features::before {
36+
background-image:
37+
radial-gradient(circle at 25% 25%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
38+
radial-gradient(circle at 75% 75%, rgba(253, 181, 22, 0.08) 0%, transparent 50%);
2539
}
2640

2741
.featuresHeader {
@@ -48,6 +62,12 @@
4862
max-width: 600px;
4963
margin: 0 auto;
5064
line-height: 1.6;
65+
transition: color 0.3s ease;
66+
}
67+
68+
/* Dark theme subtitle */
69+
[data-theme='dark'] .featuresSubtitle {
70+
color: #8B949E;
5171
}
5272

5373
.featureCard {
@@ -66,6 +86,15 @@
6686
overflow: hidden;
6787
}
6888

89+
/* Dark theme feature card */
90+
[data-theme='dark'] .featureCard {
91+
background: rgba(33, 38, 45, 0.9);
92+
border-color: rgba(88, 166, 255, 0.3);
93+
box-shadow:
94+
0 8px 32px rgba(0, 0, 0, 0.3),
95+
0 0 0 1px rgba(88, 166, 255, 0.2);
96+
}
97+
6998
.featureCard::before {
7099
content: '';
71100
position: absolute;
@@ -92,6 +121,15 @@
92121
border-color: rgba(88, 166, 255, 0.4);
93122
}
94123

124+
/* Dark theme feature card hover */
125+
[data-theme='dark'] .featureCard:hover {
126+
box-shadow:
127+
0 20px 60px rgba(88, 166, 255, 0.25),
128+
0 0 0 1px rgba(88, 166, 255, 0.4),
129+
0 0 40px rgba(88, 166, 255, 0.3);
130+
border-color: rgba(88, 166, 255, 0.5);
131+
}
132+
95133
.featureTitle {
96134
color: #1F2328;
97135
font-weight: 800;
@@ -104,6 +142,16 @@
104142
-webkit-background-clip: text;
105143
-webkit-text-fill-color: transparent;
106144
background-clip: text;
145+
transition: all 0.3s ease;
146+
}
147+
148+
/* Dark theme feature title */
149+
[data-theme='dark'] .featureTitle {
150+
color: #F0F6FC;
151+
background: linear-gradient(45deg, #58A6FF, #FDB516);
152+
-webkit-background-clip: text;
153+
-webkit-text-fill-color: transparent;
154+
background-clip: text;
107155
}
108156

109157
.featureDescription {
@@ -113,12 +161,25 @@
113161
font-size: 1rem;
114162
position: relative;
115163
z-index: 1;
164+
transition: color 0.3s ease;
165+
}
166+
167+
/* Dark theme feature description */
168+
[data-theme='dark'] .featureDescription {
169+
color: #8B949E;
116170
}
117171

118172
.featureDescription strong {
119173
color: #0969DA;
120174
font-weight: 700;
121175
text-shadow: 0 0 8px rgba(9, 105, 218, 0.2);
176+
transition: color 0.3s ease;
177+
}
178+
179+
/* Dark theme strong text */
180+
[data-theme='dark'] .featureDescription strong {
181+
color: #58A6FF;
182+
text-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
122183
}
123184

124185
/* Animations */

0 commit comments

Comments
 (0)