Skip to content

Opening modal changes my underlying page container width #2764

Answered by dprothero
dprothero asked this question in Q&A
Discussion options

You must be logged in to vote

Answer from @TheSisb:

Hi @dprothero , our Modal is based on reach/Modal which hides the scrollbar when the modal is visible. This can sometimes cause these kinds of side effects when you have your own styles on the body tag. I'd generally recommend moving some styles around to fix the issue:

  • Move the max-width: 1600px into the child of the body element. In this case you can add it to #__docusaurus or even its child under that.
  • Give that same element margin: 0 auto

That seems to fix the issue in my inspector. Hope this helps!

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@dprothero
Comment options

@SiTaggart
Comment options

@dprothero
Comment options

@TheSisb
Comment options

@dprothero
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by dprothero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants