Skip to content

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

Open
goingforstudying-ctrl wants to merge 2 commits intoVoltAgent:mainfrom
goingforstudying-ctrl:fix/custom-scrollbar-branding
Open

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

Conversation

@goingforstudying-ctrl
Copy link
Copy Markdown

@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, rounded emerald scrollbars with smooth hover; light/dark tracks and Firefox support via scrollbar-color.
    • Added website/src/css/scrollbar.css and imported it in website/src/css/custom.css.
  • Bug Fixes

    • Limited hover transition to the thumb to avoid global animations.
    • Fixed dark-mode root scrollbar and aligned the TOC scrollbar with brand colors.

Written for commit 7b24a77. Summary will update on new commits.

Summary by CodeRabbit

  • Style
    • Added site-wide custom scrollbar styling with WebKit and Firefox support and smooth hover transitions.
    • Made scrollbars theme-aware so colors adjust for light and dark modes.
    • Integrated the new scrollbar styles across the site and updated the Table of Contents scrollbar thumb to emerald tones (including adjusted dark-mode shades and hover states).

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
Copy Markdown

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: 7b24a77

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
Copy Markdown
Contributor

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6dbe92d9-c43a-4eb7-96ba-767f76ecc575

📥 Commits

Reviewing files that changed from the base of the PR and between e0e41c6 and 7b24a77.

📒 Files selected for processing (2)
  • website/src/css/custom.css
  • website/src/css/scrollbar.css
✅ Files skipped from review due to trivial changes (1)
  • website/src/css/scrollbar.css

📝 Walkthrough

Walkthrough

A new scrollbar.css file was added and imported at the top of custom.css. The stylesheet defines custom scrollbar styles for WebKit and Firefox, including sizes, track/thumb colors, hover transitions, and dark-mode overrides using emerald accent colors.

Changes

Cohort / File(s) Summary
Stylesheet import & TOC tweaks
website/src/css/custom.css
Added @import "./scrollbar.css"; and updated .tableOfContents scrollbar-thumb colors for default, hover, and dark-mode states to emerald shades.
New global scrollbar rules
website/src/css/scrollbar.css
Added global WebKit and Firefox scrollbar styling: dimensions, transparent track, emerald thumb with hover transition, rounded corners, and html[data-theme="dark"] overrides for dark-mode colors.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped and I painted each tiny groove,
Emerald whispers where fingers move.
Light or dark, I nibble the seam—
Smooth scrolling now, a rabbit's dream. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding custom scrollbar styling to align with the brand theme. It accurately reflects the primary objective of the PR.
Description check ✅ Passed The description is comprehensive and well-structured, covering the problem, solution, changes, and addressing the PR checklist template with relevant sections on visual design, theme support, and linking to issue #1157.
Linked Issues check ✅ Passed The PR successfully implements all coding objectives from #1157: custom scrollbar styling with emerald green branding, thin 8px width, rounded 4px corners, smooth hover transitions, light/dark theme support, and cross-browser compatibility (WebKit and Firefox).
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #1157 objectives. The PR adds scrollbar.css and updates custom.css to import it, with no extraneous modifications outside the scope of custom scrollbar styling.
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

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.

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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! 🚀

@goingforstudying-ctrl
Copy link
Copy Markdown
Author

Addressed all review feedback:

  1. Narrowed transition scopetransition: all 0.2stransition: background-color 0.2s
  2. Fixed dark mode root scrollbar — Added explicit html selectors for Firefox dark mode
  3. Unified TOC brand colors — Updated .tableOfContents scrollbar from gray to brand green

Ready for re-review! 🙏

Copy link
Copy Markdown

@JiwaniZakir JiwaniZakir left a comment

Choose a reason for hiding this comment

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

The transition: background-color 0.2s ease declaration on ::-webkit-scrollbar-thumb in scrollbar.css (line 22) has no effect — WebKit does not support CSS transitions on scrollbar pseudo-elements, so this line can be removed to avoid misleading future maintainers.

The Firefox scrollbar-width/scrollbar-color declarations are duplicated: both html and * set the same values. Since scrollbar-color and scrollbar-width are inherited properties, setting them on html alone is sufficient — the * block (lines 51–54) is redundant and adds unnecessary specificity across every element in the DOM.

The .tableOfContents::-webkit-scrollbar-thumb overrides still present in custom.css are now functionally identical to what the new global rules in scrollbar.css already produce (both use rgba(16, 185, 129, 0.3) / 0.25 for dark), making those specific rules dead weight that should be cleaned up to avoid confusion about where scrollbar colors are controlled.

Finally, the file is missing a trailing newline (flagged in the diff), which will cause issues with some linters and git tooling.

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

2 participants