Skip to content

Refactor button styling to use CSS variables - #45

Merged
oblomov-dev merged 1 commit into
mainfrom
claude/fix-button-hover-color-hCT7z
Mar 5, 2026
Merged

Refactor button styling to use CSS variables#45
oblomov-dev merged 1 commit into
mainfrom
claude/fix-button-hover-color-hCT7z

Conversation

@oblomov-dev

Copy link
Copy Markdown
Member

Summary

Simplified and standardized button styling in the documentation theme by removing custom hover state overrides and relying on VitePress CSS variables instead.

Key Changes

  • Added brand color CSS variables (--vp-c-brand-1, --vp-c-brand-2, --vp-c-brand-3) to establish a consistent color palette
  • Removed custom .VPButton.brand:hover selector that duplicated VitePress default behavior
  • Removed generic button:hover rule that applied darkred background color

Implementation Details

The changes leverage VitePress's built-in CSS variable system for button theming, eliminating redundant custom styles. The brand color variables are now centrally defined and can be reused throughout the theme, while button hover states are handled by VitePress's default styling using the existing --vp-button-brand-bg-hover variable.

https://claude.ai/code/session_01VvowmEmX6akHiHabkX7yhC

Set --vp-c-brand-1/2/3 CSS variables to override VitePress default
blue brand colors, ensuring button hover uses the correct red theme.
Removed redundant .VPButton.brand:hover and generic button:hover rules.

https://claude.ai/code/session_01VvowmEmX6akHiHabkX7yhC
@oblomov-dev
oblomov-dev merged commit 373b543 into main Mar 5, 2026
@oblomov-dev
oblomov-dev deleted the claude/fix-button-hover-color-hCT7z branch March 5, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants