Skip to content

Commit a0d558e

Browse files
committed
docs: update theme to be copy-paste'able to other projets
1 parent 8e68d14 commit a0d558e

2 files changed

Lines changed: 46 additions & 24 deletions

File tree

docs-theme/index.css

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
/* --- Project gradients --- */
2+
3+
:root {
4+
--project-gradient-startupjs: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
5+
--project-gradient-startupjs-faded: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
6+
--project-hover-startupjs: rgba(99, 102, 241, 0.1);
7+
8+
--project-gradient-cssx: linear-gradient(135deg, #58c4dc 0%, #2eb85c 50%, #a3e635 100%);
9+
--project-gradient-cssx-faded: linear-gradient(135deg, rgba(88, 196, 220, 0.25) 0%, rgba(46, 184, 92, 0.25) 50%, rgba(163, 230, 53, 0.25) 100%);
10+
--project-hover-cssx: rgba(46, 184, 92, 0.1);
11+
12+
--project-gradient-teamplay: linear-gradient(135deg, #fc9043 0%, #ef4444 100%);
13+
--project-gradient-teamplay-faded: linear-gradient(135deg, rgba(255, 150, 74, 0.25) 0%, rgba(239, 68, 68, 0.25) 100%);
14+
--project-hover-teamplay: rgba(249, 115, 22, 0.1);
15+
16+
--project-gradient-ui: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
17+
--project-gradient-ui-faded: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(236, 72, 153, 0.25) 100%);
18+
--project-hover-ui: rgba(168, 85, 247, 0.1);
19+
20+
/* Active project -- change these when copying to another project */
21+
--active-project-gradient: var(--project-gradient-cssx);
22+
--active-project-gradient-faded: var(--project-gradient-cssx-faded);
23+
--active-project-hover: var(--project-hover-cssx);
24+
25+
--rp-home-hero-title-bg: var(--active-project-gradient);
26+
}
27+
128
/* --- Layout --- */
229

330
.project-layout {
@@ -19,14 +46,9 @@
1946
}
2047
}
2148

22-
/* CSSX gradient for hero title */
23-
:root {
24-
--rp-home-hero-title-bg: linear-gradient(135deg, #58c4dc 0%, #2eb85c 50%, #a3e635 100%);
25-
}
26-
2749
/* Apply gradient to navbar title */
2850
.rp-nav__title__link span {
29-
background: linear-gradient(135deg, #58c4dc 0%, #2eb85c 50%, #a3e635 100%);
51+
background: var(--active-project-gradient);
3052
-webkit-background-clip: text;
3153
-webkit-text-fill-color: transparent;
3254
background-clip: text;
@@ -118,48 +140,48 @@
118140
-webkit-text-fill-color: black;
119141
}
120142

121-
/* === StartupJS - Blue to Purple === */
143+
/* === StartupJS === */
122144
.project-sidebar-button--startupjs .project-sidebar-button__text {
123-
background-image: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
145+
background-image: var(--project-gradient-startupjs);
124146
}
125147
.project-sidebar-button--startupjs.active {
126-
background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
148+
background: var(--project-gradient-startupjs-faded);
127149
}
128150
.project-sidebar-button--startupjs:hover:not(.active) {
129-
background: rgba(99, 102, 241, 0.1);
151+
background: var(--project-hover-startupjs);
130152
}
131153

132-
/* === CSSX - Cyan to Green to Lime === */
154+
/* === CSSX === */
133155
.project-sidebar-button--cssx .project-sidebar-button__text {
134-
background-image: linear-gradient(135deg, #58c4dc 0%, #2eb85c 50%, #a3e635 100%);
156+
background-image: var(--project-gradient-cssx);
135157
}
136158
.project-sidebar-button--cssx.active {
137-
background: linear-gradient(135deg, rgba(88, 196, 220, 0.25) 0%, rgba(46, 184, 92, 0.25) 50%, rgba(163, 230, 53, 0.25) 100%);
159+
background: var(--project-gradient-cssx-faded);
138160
}
139161
.project-sidebar-button--cssx:hover:not(.active) {
140-
background: rgba(46, 184, 92, 0.1);
162+
background: var(--project-hover-cssx);
141163
}
142164

143-
/* === Teamplay - Orange to Red === */
165+
/* === TeamPlay === */
144166
.project-sidebar-button--teamplay .project-sidebar-button__text {
145-
background-image: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
167+
background-image: var(--project-gradient-teamplay);
146168
}
147169
.project-sidebar-button--teamplay.active {
148-
background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(239, 68, 68, 0.25) 100%);
170+
background: var(--project-gradient-teamplay-faded);
149171
}
150172
.project-sidebar-button--teamplay:hover:not(.active) {
151-
background: rgba(249, 115, 22, 0.1);
173+
background: var(--project-hover-teamplay);
152174
}
153175

154-
/* === UI - Purple to Pink === */
176+
/* === UI === */
155177
.project-sidebar-button--ui .project-sidebar-button__text {
156-
background-image: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
178+
background-image: var(--project-gradient-ui);
157179
}
158180
.project-sidebar-button--ui.active {
159-
background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(236, 72, 153, 0.25) 100%);
181+
background: var(--project-gradient-ui-faded);
160182
}
161183
.project-sidebar-button--ui:hover:not(.active) {
162-
background: rgba(168, 85, 247, 0.1);
184+
background: var(--project-hover-ui);
163185
}
164186

165187
/* Mobile: hide project sidebar */

rspress.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export default defineConfig({
6868
]
6969
},
7070
nav: [
71-
{ text: 'Docs', link: '/guide/index', activeMatch: '/guide/.+' },
72-
{ text: 'API', link: '/api/index', activeMatch: '/api/.+' }
71+
{ text: 'Docs', link: '/guide/index', activeMatch: '/guide/.*' },
72+
{ text: 'API', link: '/api/index', activeMatch: '/api/.*' }
7373
]
7474
}
7575
})

0 commit comments

Comments
 (0)