Skip to content

Commit

Permalink
feat: modal now uses scrollbar-gutter (#2956)
Browse files Browse the repository at this point in the history
* Update modal.css

When opening a modal window, the scrollbar disappears, but the content shifts

This padding automatically shifts the content to the left so that the user does not notice the content moving when the scrollbar disappears

Padding is equal to the standard scrollbar width

* Update modal.css

Added scrollbar-gutter
  • Loading branch information
vadimkiryanov committed Apr 4, 2024
1 parent b1e7bad commit f05e854
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/unstyled/modal.css
Expand Up @@ -27,4 +27,5 @@
}
:root:has(:is(.modal-open, .modal:target, .modal-toggle:checked + .modal, .modal[open])) {
@apply overflow-hidden;
scrollbar-gutter: stable;
}

0 comments on commit f05e854

Please sign in to comment.