mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 02:59:13 +00:00
add notes about browser support
This commit is contained in:
@@ -31,8 +31,8 @@ export function lockBodyScrolling(lockingEl: HTMLElement) {
|
||||
// When the first lock is created, set the scroll lock size to match the scrollbar's width to prevent content from
|
||||
// shifting. We only do this on the first lock because the scrollbar width will measure zero after overflow is hidden.
|
||||
if (!document.documentElement.classList.contains('sl-scroll-lock')) {
|
||||
/** Scrollbar width + body padding calculation can go away once Safari has scrollbar-gutter support. */
|
||||
const scrollbarWidth = getScrollbarWidth() + getExistingBodyPadding(); // must be measured before the `sl-scroll-lock` class is applied
|
||||
|
||||
document.documentElement.classList.add('sl-scroll-lock');
|
||||
document.documentElement.style.setProperty('--sl-scroll-lock-size', `${scrollbarWidth}px`);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/** This can go away once Safari has scrollbar-gutter support. */
|
||||
@supports not (scrollbar-gutter: stable) {
|
||||
.sl-scroll-lock body {
|
||||
padding-right: var(--sl-scroll-lock-size) !important;
|
||||
|
||||
Reference in New Issue
Block a user