Skip to content

Commit 9755c40

Browse files
committed
feat(css): add distinct sidebar title styling for better hierarchy
- Add Roman Silver background (#838996) and Platinum text (#e5e4e2) to sidebar titles - Implement CSS variables for light/dark mode support - Style custom title elements rendered by DocSidebarItem wrapper - Improve sidebar category title hierarchy with increased spacing and borders - Add dark mode adjustments for consistent appearance Visual improvements: - Clear distinction between sidebar title and navigation items - Better visual hierarchy (title → categories → pages) - Improved scannability and navigation structure Technical: - Uses CSS variables for theme compatibility - Targets inline-styled title divs from DocSidebarItem component - Maintains backward compatibility with legacy sidebar-category-title class Fixes #32
1 parent 796df62 commit 9755c40

File tree

2 files changed

+49
-6
lines changed

2 files changed

+49
-6
lines changed

docusaurus.config.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ const config: Config = {
166166
projectName: "comapeo-docs", // Usually your repo name.
167167

168168
onBrokenLinks: "throw",
169-
markdown: {
170-
hooks: {
171-
onBrokenMarkdownLinks: "warn",
172-
},
173-
},
169+
onBrokenMarkdownLinks: "warn",
174170

175171
// Even if you don't use internationalization, you can use this field to set
176172
// useful metadata like html lang. For example, if your site is Chinese, you

src/css/custom.css

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,62 @@ img.emoji {
4949
.navbar__logo img {
5050
height: 135px;
5151
}
52+
53+
/* Sidebar title/branding area styling - CSS variables for theme support */
54+
:root {
55+
--sidebar-title-bg: #838996; /* Roman Silver */
56+
--sidebar-title-text: #e5e4e2; /* Platinum */
57+
}
58+
59+
/* Dark mode adjustments */
60+
[data-theme="dark"] {
61+
--sidebar-title-bg: #606570; /* Slightly darker for dark mode */
62+
--sidebar-title-text: #e5e4e2; /* Keep same for consistency */
63+
}
64+
65+
/* Style the custom title elements rendered by DocSidebarItem wrapper */
66+
aside[class*="sidebar"] > div > div > div[style*="fontSize"] {
67+
background-color: var(--sidebar-title-bg) !important;
68+
color: var(--sidebar-title-text) !important;
69+
margin-left: 0 !important;
70+
margin-right: 0 !important;
71+
padding: 0.8rem 1rem !important;
72+
font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
73+
text-transform: uppercase;
74+
font-size: 0.9rem !important;
75+
font-weight: bold !important;
76+
opacity: 1 !important;
77+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
78+
}
79+
80+
/* Dark mode border adjustment */
81+
[data-theme="dark"]
82+
aside[class*="sidebar"]
83+
> div
84+
> div
85+
> div[style*="fontSize"] {
86+
border-bottom-color: rgba(255, 255, 255, 0.1);
87+
}
88+
89+
/* Legacy class - keeping for backward compatibility but updating for better hierarchy */
5290
.sidebar-category-title {
5391
font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
5492
text-transform: uppercase;
5593
/* color: var(--ifm-color-primary); */
5694
font-size: 0.9rem;
5795
font-weight: bold;
5896
margin-bottom: 0.5rem;
59-
margin-top: 0.5rem;
97+
margin-top: 1rem; /* Increased from 0.5rem for more separation */
6098
margin-left: 1rem;
99+
padding-top: 0.75rem;
100+
border-top: 1px solid var(--ifm-toc-border-color);
101+
color: var(--ifm-color-emphasis-600); /* Slightly muted for hierarchy */
102+
}
103+
104+
/* First category doesn't need top border */
105+
.sidebar-category-title:first-of-type {
106+
border-top: none;
107+
margin-top: 0.5rem;
61108
}
62109

63110
/* Docs content image sizing and layout */

0 commit comments

Comments
 (0)