Skip to content

feat(styles): add global scrollbar styling with theme awareness#1158

Merged
omeraplak merged 4 commits intoVoltAgent:mainfrom
sujal12344:docs/website-scroll-bar-styling
Mar 31, 2026
Merged

feat(styles): add global scrollbar styling with theme awareness#1158
omeraplak merged 4 commits intoVoltAgent:mainfrom
sujal12344:docs/website-scroll-bar-styling

Conversation

@sujal12344
Copy link
Copy Markdown
Contributor

@sujal12344 sujal12344 commented Mar 17, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

The documentation website uses default browser scrollbars that don't match VoltAgent's design system. The scrollbars:

  • Have inconsistent appearance across different browsers
  • Don't use brand colors (emerald green)
  • Look outdated and break the modern aesthetic
  • Lack smooth hover interactions

Visual Impact:

  • No visual connection to VoltAgent's brand identity
  • Inconsistent user experience when scrolling through documentation
  • Less polished appearance compared to the rest of the site

Screenshot:

image

What is the new behavior?

Custom scrollbar styling that matches VoltAgent's design system:

  • Thin, modern scrollbars (8px width) for unobtrusive appearance
  • Brand color integration using emerald green (#10b981) for scrollbar thumb
  • Theme-aware styling with proper support for both light and dark modes
  • Smooth hover effects that increase opacity for better interactivity
  • Cross-browser support using both modern CSS properties and webkit prefixes

Visual Improvements:

  • Scrollbars now reinforce brand identity throughout the documentation
  • Consistent appearance across the entire site
  • Professional, polished look that matches the modern design system
  • Better visual hierarchy without being distracting

Screenshot:

image

fixes #1157

Notes for reviewers

Testing:

  • ✅ Verified in Chrome/Edge (webkit scrollbars)
  • ✅ Verified in Firefox (scrollbar-width/scrollbar-color)
  • ✅ Tested in both light and dark themes
  • ✅ Hover states work smoothly

Implementation details:

  • Added global scrollbar styles to custom.css
  • Uses rgba(16, 185, 129, 0.3) for scrollbar thumb (brand emerald color)
  • Maintains existing TOC-specific scrollbar styles
  • No breaking changes or conflicts with existing styles

The scrollbar should be subtle but visible, with a nice emerald green color that matches links and active states throughout the site.


Summary by cubic

Adds global, theme-aware scrollbar styles to the docs site for a consistent look across browsers. Fixes #1157.

  • New Features
    • Thin 8px scrollbars with smooth hover.
    • Theme-aware tracks and thumbs: light uses soft gray tracks, dark uses subtle dark tracks.
    • Firefox and WebKit support via scrollbar-width/scrollbar-color and pseudo-elements; transparent corners.
    • Implemented in website/src/css/custom.css; light mode excludes .tableOfContents to preserve TOC styles.

Written for commit 6da8fda. Summary will update on new commits.

Summary by CodeRabbit

  • Style
    • Enhanced global, theme-aware scrollbar styling across the website: coordinated dark and light variants, refined hover states, corner/background handling, and improved visual consistency for smoother, more polished scrolling. Light-mode excludes the table-of-contents area, which receives tailored scrollbar tweaks for focused presentation.

Copilot AI review requested due to automatic review settings March 17, 2026 17:58
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 17, 2026

⚠️ No Changeset found

Latest commit: 6da8fda

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 17, 2026

📝 Walkthrough

Walkthrough

Adds global, theme-aware scrollbar CSS to website/src/css/custom.css, introducing universal and WebKit-specific rules for scrollbar width, track, thumb, hover, corner, and separate dark/light theme color variants; duplicated blocks appear in two locations. No runtime logic changes.

Changes

Cohort / File(s) Summary
Scrollbar Styling
website/src/css/custom.css
Added ~64 lines of CSS implementing global scrollbar styling: scrollbar-width/scrollbar-color and WebKit pseudo-elements (::-webkit-scrollbar, ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-corner) with distinct dark and light theme color ramps, hover states, and a TOC exception; duplicated blocks present in two spots.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble code with quiet cheer,
Emerald trails appear near,
Light and dark, a silky glide,
Tiny thumbs on every side,
Hops of joy as scrolls abide.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding global, theme-aware scrollbar styling to enhance the website's visual design.
Linked Issues check ✅ Passed The PR successfully addresses all coding objectives from issue #1157: custom scrollbar styling with brand emerald color, 8px width, theme-aware styling for light/dark modes, cross-browser support, and hover effects.
Out of Scope Changes check ✅ Passed All changes in website/src/css/custom.css are directly scoped to implementing custom scrollbar styling. No unrelated modifications to runtime logic, components, or other functionality were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description fully complies with the template, covering all required sections with detailed information about current behavior, new behavior, issue linking, testing, docs, and changesets.

✏️ 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

@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.

🧹 Nitpick comments (1)
website/src/css/custom.css (1)

5386-5448: Good implementation of theme-aware scrollbar styling.

The cross-browser approach is correct (standard CSS for Firefox + WebKit prefixes), brand colors are consistent, and theme variants are properly structured.

One observation: The PR description mentions "smooth hover opacity transitions" but there's no transition property declared. The hover color changes will be instant rather than animated.

💡 Optional: Add transition for smooth hover effect
 *::-webkit-scrollbar-thumb {
   background-color: rgba(16, 185, 129, 0.3);
   border-radius: 4px;
   border: 2px solid transparent;
   background-clip: padding-box;
+  transition: background-color 0.2s ease;
 }

Note: CSS transitions on scrollbar pseudo-elements have limited browser support, so this may not work in all browsers. Test in target browsers if adding.

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

In `@website/src/css/custom.css` around lines 5386 - 5448, Add a transition so the
hover color change is animated: update the scrollbar thumb rules (selectors
*::-webkit-scrollbar-thumb, [data-theme="dark"] *::-webkit-scrollbar-thumb, and
[data-theme="light"] *::-webkit-scrollbar-thumb) to include a transition (e.g.,
transition: background-color 150ms ease or transition: background-color 150ms
ease, opacity 150ms ease). Keep the hover rules
(*::-webkit-scrollbar-thumb:hover and the two theme-specific :hover selectors)
as-is; no JS changes needed. Note: Firefox uses scrollbar-color which cannot be
transitioned reliably, so this change targets WebKit scrollbar thumbs only.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@website/src/css/custom.css`:
- Around line 5386-5448: Add a transition so the hover color change is animated:
update the scrollbar thumb rules (selectors *::-webkit-scrollbar-thumb,
[data-theme="dark"] *::-webkit-scrollbar-thumb, and [data-theme="light"]
*::-webkit-scrollbar-thumb) to include a transition (e.g., transition:
background-color 150ms ease or transition: background-color 150ms ease, opacity
150ms ease). Keep the hover rules (*::-webkit-scrollbar-thumb:hover and the two
theme-specific :hover selectors) as-is; no JS changes needed. Note: Firefox uses
scrollbar-color which cannot be transitioned reliably, so this change targets
WebKit scrollbar thumbs only.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 35cbca41-7363-437c-84c7-6bc659ce4809

📥 Commits

Reviewing files that changed from the base of the PR and between b523a60 and e63d2b9.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds theme-aware global scrollbar styling to the documentation website so scrollbars better match VoltAgent’s brand colors and provide consistent visuals across browsers (webkit + Firefox).

Changes:

  • Introduces global scrollbar styling via scrollbar-width / scrollbar-color and ::-webkit-scrollbar* rules.
  • Adds explicit light/dark theme variants for scrollbar thumb + track colors.
  • Keeps existing TOC scrollbar rules in place (but the new global theme rules currently override parts of them).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

No issues found across 1 file

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@necatiozmen
Copy link
Copy Markdown
Member

necatiozmen commented Mar 17, 2026

Thanks for the PR. We’re planning to update the landing page design soon, could you update the color to black dark tone or dark grey instead of green

@necatiozmen necatiozmen reopened this Mar 17, 2026
@sujal12344
Copy link
Copy Markdown
Contributor Author

sujal12344 commented Mar 17, 2026

@necatiozmen Yes, sure can you assign it to me, I'll update the PR

@sujal12344
Copy link
Copy Markdown
Contributor Author

sujal12344 commented Mar 18, 2026

Thanks for the PR. We’re planning to update the landing page design soon, could you update the color to black dark tone or dark grey instead of green

image Now is it okay? @necatiozmen

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

🤖 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/custom.css`:
- Around line 5429-5431: The dark-mode global track rule `[data-theme="dark"]
*::-webkit-scrollbar-track` is overriding `.tableOfContents`'s transparent track
due to equal specificity; modify the dark selector to exclude the table of
contents (e.g., change to `[data-theme="dark"]
*:not(.tableOfContents)::-webkit-scrollbar-track`) so `.tableOfContents`'s rule
remains transparent, or alternatively add a more specific rule for
`.tableOfContents::-webkit-scrollbar-track` under dark theme to force
`background: transparent`; update the selector referencing `[data-theme="dark"]
*::-webkit-scrollbar-track` and `.tableOfContents` accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 422a4868-8ca2-4d43-bb5e-36aa21ae7d51

📥 Commits

Reviewing files that changed from the base of the PR and between f4a3dc7 and dd448a9.

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

@sujal12344
Copy link
Copy Markdown
Contributor Author

@necatiozmen @omeraplak waiting for your reply and merging it

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 light mode block excludes .tableOfContents via :not(.tableOfContents) in custom.css, but the dark mode block ([data-theme="dark"] *) has no equivalent exclusion — meaning the TOC will receive inconsistent scrollbar treatment depending on the active theme. That exclusion should either be applied symmetrically to both themes or dropped entirely if it's no longer needed.

Applying scrollbar styles to the universal selector * is also worth reconsidering. This forces the browser to match and compute these properties on every element in the DOM, which can have a non-trivial cascade cost on complex pages. Scoping to html, body, or specific scrollable containers (e.g. .main-wrapper, [class*="scrollable"]) would be more targeted and avoid potential conflicts with third-party components or embedded iframes that manage their own scrollbar appearance.

Finally, the base * block sets scrollbar-color: rgba(75, 85, 99, 0.4) transparent unconditionally, but then both [data-theme="light"] and [data-theme="dark"] override it. If there's ever a state where neither data-theme attribute is set (e.g., during SSR hydration or initial page load in Docusaurus), the default values from the * block will show through — worth verifying that the flash behavior is acceptable or that Docusaurus always guarantees the attribute is present before paint.

@sujal12344
Copy link
Copy Markdown
Contributor Author

@necatiozmen @omeraplak atleast give the feedback, sir, on what you think

@sujal12344 sujal12344 requested a review from JiwaniZakir March 31, 2026 15:55
@omeraplak omeraplak merged commit 42f4cc7 into VoltAgent:main Mar 31, 2026
19 of 23 checks passed
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

5 participants