|
130 | 130 | // this reason, we disable scroll snapping until this is resolved (#1667).
|
131 | 131 | // scroll-snap-type: y mandatory;
|
132 | 132 | scrollbar-width: thin;
|
| 133 | + scrollbar-gutter: stable; |
133 | 134 | scrollbar-color: var(--md-default-fg-color--lighter) transparent;
|
134 | 135 |
|
135 | 136 | // Sidebar scroll wrapper on hover
|
|
154 | 155 | }
|
155 | 156 | }
|
156 | 157 |
|
157 |
| - // Sidebar wrapper |
158 |
| - &__inner { |
159 |
| - |
160 |
| - // Hack: the scrollbar is only visible when the sidebar's contents overflow, |
161 |
| - // which is nice, but leads to the problem where the chevrons of expandable |
162 |
| - // sections will jump by `4px` when the sidebar is shown. We wanted to fix |
163 |
| - // this problem for so long, but haven't found a clean way of doing it. |
164 |
| - // Until now. The following declaration is only applied to Webkit browsers |
165 |
| - // (e.g. Chrome and Safari), which support styling of scrollbars. The trick |
166 |
| - // is to add conditional padding on the side of the scrollbar only if the |
167 |
| - // sidebar's content doesn't overflow. This hack is inspired and adapted |
168 |
| - // from Ayke van Laëthem's year old trick – see https://bit.ly/3Sb1qql |
169 |
| - @supports selector(::-webkit-scrollbar) { |
| 158 | + // Hack: the scrollbar is only visible when the sidebar's contents overflow, |
| 159 | + // which is nice, but leads to the problem where the chevrons of expandable |
| 160 | + // sections will jump by `4px` when the sidebar is shown. We wanted to fix |
| 161 | + // this problem for so long, but haven't found a clean way of doing it. |
| 162 | + // Until now. The following declaration is only applied to Webkit browsers |
| 163 | + // (e.g. Chrome and Safari), which support styling of scrollbars. The trick |
| 164 | + // is to add conditional padding on the side of the scrollbar only if the |
| 165 | + // sidebar's content doesn't overflow. This hack is inspired and adapted |
| 166 | + // from Ayke van Laëthem's year old trick – see https://bit.ly/3Sb1qql |
| 167 | + @supports selector(::-webkit-scrollbar) { |
| 168 | + |
| 169 | + // Sidebar scroll wrapper |
| 170 | + &__scrollwrap { |
| 171 | + scrollbar-gutter: auto; |
| 172 | + } |
| 173 | + |
| 174 | + // Sidebar wrapper |
| 175 | + &__inner { |
170 | 176 | padding-inline-end: calc(100% - #{px2rem(230px)});
|
171 | 177 | }
|
172 | 178 | }
|
|
0 commit comments