Skip to content

fix(styles): prevent scrollbar width shift when toggling themes#3400

Merged
kamilmysliwiec merged 1 commit intonestjs:masterfrom
vansh-vm04:fix/dark-mode
Apr 15, 2026
Merged

fix(styles): prevent scrollbar width shift when toggling themes#3400
kamilmysliwiec merged 1 commit intonestjs:masterfrom
vansh-vm04:fix/dark-mode

Conversation

@vansh-vm04
Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Docs
  • Other... Please describe:

What is the current behavior?

In light mode, the scrollbar uses the browser's default styling, while dark mode applies a custom scrollbar with a fixed width of 10px. This inconsistency causes a horizontal layout shift when switching between light and dark themes due to the difference in scrollbar width.

before.mp4

Issue Number: N/A

What is the new behavior?

Added explicit scrollbar styling for light mode to match the dark mode configuration (10px width). This ensures consistent scrollbar width across both themes and prevents layout shift when toggling between light and dark modes.

after.mp4

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Previously, dark mode had explicit scrollbar styling with 10px width, while
light mode relied on the browser's default scrollbar width. This caused the
page content to shift horizontally when users switched between themes.

Add scrollbar styling to light mode that matches dark mode's configuration,
ensuring consistent scrollbar width (10px) across both themes. This prevents
the layout shift and provides a smoother theme switching experience.
@kamilmysliwiec kamilmysliwiec merged commit 5e904ad into nestjs:master Apr 15, 2026
4 checks passed
@kamilmysliwiec
Copy link
Copy Markdown
Member

lgtm

@vansh-vm04 vansh-vm04 deleted the fix/dark-mode branch April 16, 2026 03:00
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