-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make sidebar menu medium font weight #1853
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces targeted CSS modifications for VitePress sidebar items. The changes focus on setting specific font weights for sidebar items at different hierarchy levels and defining a color style for active sidebar items. These adjustments enhance the visual presentation and readability of the sidebar navigation by ensuring consistent font styling and highlighting the currently selected item. Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.vitepress/theme/style.css (1)
162-166
: Consider alternative to !important if possibleWhile
!important
works here, it's generally better to avoid it if possible. Consider increasing selector specificity instead:-.VPSidebarItem.level-1 .text, -.VPSidebarItem.level-2 .text, -.VPSidebarItem.level-3 .text { - font-weight: 500 !important; +.vp-doc .VPSidebarItem.level-1 .text, +.vp-doc .VPSidebarItem.level-2 .text, +.vp-doc .VPSidebarItem.level-3 .text { + font-weight: 500; }However, if this doesn't override the framework styles, keeping
!important
is acceptable for theme customization.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.vitepress/theme/style.css
(1 hunks)
🔇 Additional comments (1)
.vitepress/theme/style.css (1)
168-170
: LGTM! Good use of CSS variablesThe implementation correctly uses the brand color variable for active sidebar items, maintaining consistency with the theme's color system.
.vitepress/theme/style.css
Outdated
.VPSidebarItem.level-1 .text, | ||
.VPSidebarItem.level-2 .text, | ||
.VPSidebarItem.level-3 .text { | ||
font-weight: normal !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align implementation with PR objective: use medium font weight
The PR objective states "make sidebar menu medium font weight", but the implementation sets it to normal
. Since the Untitled-Sans font is available in medium weight (500), we should use that instead.
Apply this diff to align with the PR objective:
.VPSidebarItem.level-1 .text,
.VPSidebarItem.level-2 .text,
.VPSidebarItem.level-3 .text {
- font-weight: normal !important;
+ font-weight: 500 !important;
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
.VPSidebarItem.level-1 .text, | |
.VPSidebarItem.level-2 .text, | |
.VPSidebarItem.level-3 .text { | |
font-weight: normal !important; | |
} | |
.VPSidebarItem.level-1 .text, | |
.VPSidebarItem.level-2 .text, | |
.VPSidebarItem.level-3 .text { | |
font-weight: 500 !important; | |
} |
Overview
Modifies the font weight on sidebar, making it look less bold.
Update:
Original:
Summary by CodeRabbit