Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active May 18, 2020 20:44
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save davidgilbertson/085c3ba65899738827d1e7fb2c6565b3 to your computer and use it in GitHub Desktop.
Save davidgilbertson/085c3ba65899738827d1e7fb2c6565b3 to your computer and use it in GitHub Desktop.
/* the page should not change width as content is loaded */
body {
overflow-y: scroll;
}
/* block scrolling without losing the scroll bar and shifting the page */
/* add this class when a modal is open */
body.block-scroll {
overflow: hidden;
overflow-y: scroll !important;
position: fixed;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment