Skip to content

Commit

Permalink
fix(scrollbar): fix track color in nested context (#2363)
Browse files Browse the repository at this point in the history
Previously, when having a visible track on an outer scrollbar,
the inner scrollbar inherits the track color.
With this change, all variables are always redefined to allow nested scrollbars.
  • Loading branch information
jeripeierSBB committed Jan 24, 2024
1 parent aa409e7 commit 82a4ad8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/core/styles/mixins/scrollbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
--sbb-scrollbar-track-color: var(--sbb-color-iron-default);
}

@mixin scrollbar-variables--track-invisible {
--sbb-scrollbar-track-color: transparent;
}

@mixin scrollbar-variables($size: thin, $negative: false, $track-visible: false) {
@if $size == thin {
@include scrollbar-variables--size-thin;
Expand All @@ -89,6 +93,8 @@
@include scrollbar-variables--color-negative-track-visible;
} @else if $track-visible {
@include scrollbar-variables--color-positive-track-visible;
} @else {
@include scrollbar-variables--track-invisible;
}
}

Expand Down

0 comments on commit 82a4ad8

Please sign in to comment.