Skip to content

docs: Add custom scrollbar styling to match brand theme#1165

Open
goingforstudying-ctrl wants to merge 1 commit intoVoltAgent:mainfrom
goingforstudying-ctrl:fix/custom-scrollbar-branding
Open

docs: Add custom scrollbar styling to match brand theme#1165
goingforstudying-ctrl wants to merge 1 commit intoVoltAgent:mainfrom
goingforstudying-ctrl:fix/custom-scrollbar-branding

Conversation

@goingforstudying-ctrl
Copy link

@goingforstudying-ctrl goingforstudying-ctrl commented Mar 19, 2026

Summary

Implement custom scrollbar styling for the documentation website that aligns with VoltAgent's modern design system and emerald green brand color.

Problem

The documentation website currently uses default browser scrollbars that don't match the site's carefully crafted design system, creating an inconsistent user experience.

Solution

Custom Scrollbar Implementation

Visual Design:

  • Thin scrollbar (8px width) for modern, unobtrusive appearance
  • Emerald green thumb (rgba(16, 185, 129, 0.3)) matching brand colors
  • Rounded corners (4px border-radius) for consistency
  • Smooth opacity transitions on hover

Theme Support:

  • Light mode: Emerald scrollbar with dark transparent track
  • Dark mode: Emerald scrollbar with light transparent track
  • Firefox support via scrollbar-color property

Changes

  • Created website/src/css/scrollbar.css with custom WebKit scrollbar styles
  • Updated website/src/css/custom.css to import scrollbar styles
  • Support for both WebKit and Firefox browsers

Screenshots

The scrollbar now uses VoltAgent's signature emerald green (#10b981) with:

  • Subtle default state (30% opacity)
  • Enhanced hover state (50% opacity)
  • Proper contrast ratios for accessibility

Fixes #1157


Summary by cubic

Add custom, thin emerald scrollbars to the docs to match the brand and improve visual consistency across light and dark themes. Fixes #1157.

  • New Features
    • 8px scrollbar with rounded emerald thumb and smooth hover transitions.
    • Theme-aware: light/dark track colors and Firefox support via scrollbar-color.
    • Implementation: added website/src/css/scrollbar.css and imported it in website/src/css/custom.css.

Written for commit e0e41c6. Summary will update on new commits.

Summary by CodeRabbit

  • Style
    • Added custom scrollbar styling with comprehensive browser support for WebKit and Firefox.
    • Implemented theme-aware scrollbar appearance that automatically adjusts colors based on dark and light mode preferences.
    • Enhanced scrollbar visual design including customized dimensions, track backgrounds, thumb colors, and hover transitions for consistency across the website.

Implement custom scrollbar styling for documentation website that aligns
with VoltAgent's modern design system and emerald green brand color (#10b981).

Changes:
- Add scrollbar.css with custom WebKit scrollbar styles
- Import scrollbar styles in custom.css
- Support both light and dark themes
- Firefox scrollbar support via scrollbar-color

Design specifications:
- 8px width for modern, unobtrusive appearance
- Emerald green thumb (rgba(16, 185, 129, 0.3)) matching brand
- Rounded corners (4px border-radius)
- Smooth hover transitions
- Proper contrast for accessibility

Fixes VoltAgent#1157
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: e0e41c6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

A new custom scrollbar stylesheet is imported into the main CSS file and defines scrollbar styling for both WebKit and Firefox browsers, with support for light and dark themes using emerald green accent colors matching the brand design system.

Changes

Cohort / File(s) Summary
Custom Scrollbar Styling
website/src/css/custom.css, website/src/css/scrollbar.css
Added new scrollbar stylesheet import in custom CSS and created scrollbar styling rules supporting WebKit (::-webkit-scrollbar*) and Firefox (scrollbar-width/scrollbar-color). Includes theme-aware styling with emerald green thumbs and adjusted track colors for dark mode.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Hop, hop, hooray! The scrollbars now shine,
In emerald green—how divine!
Dark mode or light, they glide so smooth,
A polished look, brand new groove! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding custom scrollbar styling to match the brand theme, which is the primary focus of this PR.
Description check ✅ Passed The description is comprehensive and covers problem, solution, visual design specs, theme support, and browser compatibility, though it lacks explicit testing and changeset information from the template.
Linked Issues check ✅ Passed All coding requirements from issue #1157 are met: custom scrollbar implementation with emerald green (#10b981), 8px width, 4px border-radius, theme-aware styling, and cross-browser support.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing custom scrollbar styling per issue #1157; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="website/src/css/custom.css">

<violation number="1" location="website/src/css/custom.css:1">
P2: Global brand scrollbar import is overridden by existing TOC-specific scrollbar rules, causing TOC to keep old gray styling and break theme consistency.</violation>
</file>

<file name="website/src/css/scrollbar.css">

<violation number="1" location="website/src/css/scrollbar.css:50">
P2: Dark-mode scrollbar overrides use descendant selectors and miss the root element, so viewport scrollbar colors may stay light in dark theme.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@@ -1,3 +1,4 @@
@import "./scrollbar.css";
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Global brand scrollbar import is overridden by existing TOC-specific scrollbar rules, causing TOC to keep old gray styling and break theme consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At website/src/css/custom.css, line 1:

<comment>Global brand scrollbar import is overridden by existing TOC-specific scrollbar rules, causing TOC to keep old gray styling and break theme consistency.</comment>

<file context>
@@ -1,3 +1,4 @@
+@import "./scrollbar.css";
 @tailwind base;
 @tailwind components;
</file context>
Fix with Cubic

@@ -0,0 +1,52 @@
/* ============================================
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Dark-mode scrollbar overrides use descendant selectors and miss the root element, so viewport scrollbar colors may stay light in dark theme.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At website/src/css/scrollbar.css, line 50:

<comment>Dark-mode scrollbar overrides use descendant selectors and miss the root element, so viewport scrollbar colors may stay light in dark theme.</comment>

<file context>
@@ -0,0 +1,52 @@
+  scrollbar-color: rgba(16, 185, 129, 0.3) transparent;
+}
+
+html[data-theme="dark"] * {
+  scrollbar-color: rgba(16, 185, 129, 0.25) rgba(255, 255, 255, 0.05);
+}
</file context>
Fix with Cubic

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
website/src/css/scrollbar.css (1)

20-20: Narrow transition scope to background-color.

Line 20 uses transition: all, but only color changes here. Limiting it improves maintainability and avoids unintended animations later.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/src/css/scrollbar.css` at line 20, The rule uses a broad transition
declaration ("transition: all 0.2s ease;") in the scrollbar CSS; narrow it to
only animate background-color to avoid unintended animations later by replacing
that all-encompassing declaration with a transition that targets
background-color (keep the same duration/timing). Locate the selector containing
the transition line in scrollbar.css and update the declaration so only
background-color is transitioned.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@website/src/css/scrollbar.css`:
- Around line 17-25: The scrollbar thumb opacity is too low for accessibility;
update the ::-webkit-scrollbar-thumb default and hover styles to higher-contrast
values (e.g., increase rgba alpha from 0.3 to around 0.6 for the default and
from 0.5 to around 0.8 for :hover) so the green thumb is more visible, and apply
the same adjustment to the other similar blocks referenced (lines covering the
alternate theme selectors around 36-42 and 45-52) — modify the CSS rules for
::-webkit-scrollbar-thumb and ::-webkit-scrollbar-thumb:hover accordingly.

---

Nitpick comments:
In `@website/src/css/scrollbar.css`:
- Line 20: The rule uses a broad transition declaration ("transition: all 0.2s
ease;") in the scrollbar CSS; narrow it to only animate background-color to
avoid unintended animations later by replacing that all-encompassing declaration
with a transition that targets background-color (keep the same duration/timing).
Locate the selector containing the transition line in scrollbar.css and update
the declaration so only background-color is transitioned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c945272b-16f3-4a29-b7a9-89b94bb66fd2

📥 Commits

Reviewing files that changed from the base of the PR and between 6f14c4d and e0e41c6.

📒 Files selected for processing (2)
  • website/src/css/custom.css
  • website/src/css/scrollbar.css

Comment on lines +17 to +25
::-webkit-scrollbar-thumb {
background: rgba(16, 185, 129, 0.3);
border-radius: 4px;
transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
background: rgba(16, 185, 129, 0.5);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Increase default thumb contrast to meet accessibility intent.

Current default thumb opacity is too subtle (especially Line 18 and Line 37), making the scrollbar hard to perceive in both themes. This conflicts with the PR’s accessibility objective.

🎯 Suggested contrast-safe adjustment
 ::-webkit-scrollbar-thumb {
-  background: rgba(16, 185, 129, 0.3);
+  background: rgba(16, 185, 129, 0.55);
   border-radius: 4px;
-  transition: all 0.2s ease;
+  transition: background-color 0.2s ease;
 }
 
 ::-webkit-scrollbar-thumb:hover {
-  background: rgba(16, 185, 129, 0.5);
+  background: rgba(16, 185, 129, 0.75);
 }
 
 html[data-theme="dark"] ::-webkit-scrollbar-thumb {
-  background: rgba(16, 185, 129, 0.25);
+  background: rgba(16, 185, 129, 0.5);
 }
 
 html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
-  background: rgba(16, 185, 129, 0.45);
+  background: rgba(16, 185, 129, 0.7);
 }
 
 * {
   scrollbar-width: thin;
-  scrollbar-color: rgba(16, 185, 129, 0.3) transparent;
+  scrollbar-color: rgba(16, 185, 129, 0.55) transparent;
 }
 
 html[data-theme="dark"] * {
-  scrollbar-color: rgba(16, 185, 129, 0.25) rgba(255, 255, 255, 0.05);
+  scrollbar-color: rgba(16, 185, 129, 0.5) rgba(255, 255, 255, 0.08);
 }

Also applies to: 36-42, 45-52

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/src/css/scrollbar.css` around lines 17 - 25, The scrollbar thumb
opacity is too low for accessibility; update the ::-webkit-scrollbar-thumb
default and hover styles to higher-contrast values (e.g., increase rgba alpha
from 0.3 to around 0.6 for the default and from 0.5 to around 0.8 for :hover) so
the green thumb is more visible, and apply the same adjustment to the other
similar blocks referenced (lines covering the alternate theme selectors around
36-42 and 45-52) — modify the CSS rules for ::-webkit-scrollbar-thumb and
::-webkit-scrollbar-thumb:hover accordingly.

@goingforstudying-ctrl
Copy link
Author

@cubic-dev-ai Thanks for the detailed review! I'll address both CSS issues:

  1. Global scrollbar import override: You're right - I'll check the TOC-specific rules and ensure our brand scrollbar takes precedence
  2. Dark-mode scrollbar overrides: I'll fix the selectors to properly target the root element

@coderabbitai Thanks for the nitpick on the transition scope - I'll narrow it to background-color only.

Will push fixes shortly!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

Tip

For best results, initiate chat on the files or code changes.

@goingforstudying-ctrl Sounds great! Just to confirm, the suggested change for the transition would look like this:

/* Before */
transition: all 0.2s ease;

/* After */
transition: background-color 0.2s ease;

This ensures only the background-color animates on hover, avoiding unintended side effects from transitioning unrelated properties (e.g., width, opacity, or layout-affecting properties). Looking forward to your updated push! 🚀

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.

[DOC] Improve website scrollbar styling to match brand theme and enhance user experience

1 participant