Skip to content

Commit bc177ba

Browse files
committed
refactor / mkdocs style
1 parent dbedba8 commit bc177ba

File tree

3 files changed

+61
-88
lines changed

3 files changed

+61
-88
lines changed

docs/assets/extra.css

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,64 @@
3232

3333
/* Alternative full-height gradient for the header */
3434
.md-header {
35-
position: relative;
35+
position: sticky !important;
36+
top: 0 !important;
37+
z-index: 100 !important;
3638
}
3739

3840
/* Make sure the gradient looks good in both light and dark modes */
3941
[data-md-color-scheme="default"] .custom-gradient-banner,
4042
[data-md-color-scheme="slate"] .custom-gradient-banner {
4143
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
4244
}
45+
46+
/* Custom styles for task and note admonitions with purple-pink color */
47+
.md-typeset .admonition.task,
48+
.md-typeset details.task {
49+
border-color: #7C4ACD;
50+
}
51+
52+
.md-typeset .task > .admonition-title,
53+
.md-typeset .task > summary {
54+
background-color: rgba(124, 74, 205, 0.1);
55+
}
56+
57+
.md-typeset .task > .admonition-title::before,
58+
.md-typeset .task > summary::before {
59+
background-color: #7C4ACD;
60+
}
61+
62+
.md-typeset .admonition.note,
63+
.md-typeset details.note {
64+
border-color: #7C4ACD;
65+
}
66+
67+
.md-typeset .note > .admonition-title,
68+
.md-typeset .note > summary {
69+
background-color: rgba(124, 74, 205, 0.1);
70+
}
71+
72+
.md-typeset .note > .admonition-title::before,
73+
.md-typeset .note > summary::before {
74+
background-color: #7C4ACD;
75+
}
76+
77+
/* Make navigation sidebar sticky */
78+
.md-sidebar {
79+
position: sticky !important;
80+
top: 4.8rem !important; /* Adjust based on the header height */
81+
height: calc(100vh - 4.8rem) !important;
82+
overflow-y: auto !important;
83+
}
84+
85+
/* Ensure sidebar scrolls properly when content overflows */
86+
.md-sidebar__scrollwrap {
87+
height: 100% !important;
88+
}
89+
90+
/* Make tabs sticky */
91+
.md-tabs {
92+
position: sticky !important;
93+
top: 4.8rem !important; /* Height of the header */
94+
z-index: 99 !important;
95+
}

docs/overrides/partials/header.html

Lines changed: 0 additions & 75 deletions
This file was deleted.

mkdocs.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,20 @@ theme:
4444

4545
# Theme Modes ...............................................
4646
palette:
47-
# Palette toggle for automatic mode
48-
- media: "(prefers-color-scheme)"
49-
toggle:
50-
icon: material/brightness-auto
51-
name: Switch to light mode
5247
# Palette toggle for light mode
53-
- media: "(prefers-color-scheme: light)"
54-
scheme: default
48+
- scheme: default
5549
primary: blue
5650
accent: pink
5751
toggle:
58-
icon: material/brightness-2
52+
icon: material/brightness-7
5953
name: Switch to dark mode
6054
# Palette toggle for dark mode
61-
- media: "(prefers-color-scheme: dark)"
62-
scheme: slate
55+
- scheme: slate
6356
primary: green
6457
accent: cyan
6558
toggle:
6659
icon: material/brightness-4
67-
name: Switch to system preference
60+
name: Switch to light mode
6861

6962
# Theme Features ...............................................
7063
features:
@@ -73,14 +66,16 @@ theme:
7366
- navigation.instant.progress # load progress indicator
7467
- navigation.tracking # tracks anchor tags in URL
7568
- navigation.tabs # tabbed on desktop, single in mobile
76-
- navigation.tabs.sticky # tabs stick when scrolling downtheme:
69+
- navigation.tabs.sticky # tabs stick when scrolling down
70+
- header.sticky # header sticks to top when scrolling
7771
- navigation.path # add breadcrumbs
7872
- navigation.indexes # default index.md in folder is section page
7973
- navigation.top
8074
- toc.follow
8175
- navigation.footer
8276
- content.code.copy # allow copy-paste from codeblocks
8377
- content.tabs.link # Ensures site-wide switch to same tab name
78+
- navigation.sticky # sticky sidebar navigation
8479

8580
# Extras ...............................................
8681
extra:

0 commit comments

Comments
 (0)