diff --git a/site/src/index.css b/site/src/index.css index 36f1c62954614..04b388a5cba99 100644 --- a/site/src/index.css +++ b/site/src/index.css @@ -112,4 +112,17 @@ html { scrollbar-gutter: stable; } + + /* + This is a temporary fix for MUI Modals/Popovers until they are removed. + When html has scrollbar-gutter: stable, the browser reserves space for the scrollbar. + MUI Modals/Popovers, when locking body scroll, add `overflow: hidden` and `padding-right` + to the body to compensate for the scrollbar they are hiding. This added padding-right + conflicts with the already reserved gutter space, causing a layout shift. + This rule overrides MUI's added padding-right on the body specifically when MUI + is likely to have set both overflow:hidden and padding-right. + */ + body[style*="overflow: hidden"][style*="padding-right"] { + padding-right: 0px !important; + } }