Skip to content

Commit e575fdb

Browse files
authored
Merge pull request #7028 from continuedev/bdougie/con-3140
docs: smooth scrolling
2 parents 018d8dd + 3657e5d commit e575fdb

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

docs/custom.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Custom CSS for Continue documentation */
2+
3+
/* Enable smooth scrolling for anchor links */
4+
html {
5+
scroll-behavior: smooth;
6+
/* Adjust scroll padding to account for fixed header */
7+
scroll-padding-top: 80px;
8+
}
9+
10+
/* Ensure proper spacing for heading anchors */
11+
h1[id],
12+
h2[id],
13+
h3[id],
14+
h4[id],
15+
h5[id],
16+
h6[id] {
17+
scroll-margin-top: 80px;
18+
}
19+
20+
/* Optional: Add a subtle highlight effect when navigating to anchors */
21+
:target {
22+
animation: highlight 2s ease-out;
23+
}
24+
25+
@keyframes highlight {
26+
0% {
27+
background-color: rgba(255, 235, 59, 0.3);
28+
}
29+
100% {
30+
background-color: transparent;
31+
}
32+
}

docs/docs.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@
337337
"apiKey": "phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs"
338338
}
339339
},
340+
"custom": {
341+
"css": ["custom.css"]
342+
},
340343
"redirects": [
341344
{
342345
"source": "/hub",

0 commit comments

Comments
 (0)