Skip to content

Commit

Permalink
fix(sidebar): incorrect offset and z-index on mobile
Browse files Browse the repository at this point in the history
fixes #8646
fixes #8702
  • Loading branch information
LeoMcA committed May 15, 2023
1 parent 80094ea commit 4b10be8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 9 additions & 7 deletions client/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,18 @@
--article-actions-container-height: 2rem;
--icon-size: 1rem;
--sticky-header-height: calc(
var(--top-nav-height) + var(--article-actions-container-height) + 2px
var(--top-nav-height) + var(--article-actions-container-height) + 3px
);
}

.top-banner.visible ~ *,
.top-banner.loading ~ * {
--sticky-header-height: calc(
var(--top-nav-height) + var(--article-actions-container-height) +
var(--top-banner-outer-height) + 2px
);
@media screen and (min-width: $screen-md) {
.top-banner.visible ~ *,
.top-banner.loading ~ * {
--sticky-header-height: calc(
var(--top-nav-height) + var(--article-actions-container-height) +
var(--top-banner-outer-height) + 2px
);
}
}

@media screen and (min-width: $screen-md) {
Expand Down
2 changes: 2 additions & 0 deletions client/src/document/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ kbd {
--max-height: calc(100vh - var(--offset));

@media screen and (max-width: $screen-lg) {
z-index: var(--z-index-top);

.mdn-cta-container ~ .document-page & {
// minus 3 rem to ~ account for the top banner
--offset: calc(var(--sticky-header-height) + 3rem);
Expand Down

0 comments on commit 4b10be8

Please sign in to comment.