Skip to content

Commit f6cc0f2

Browse files
committed
fix(docs): reserve space for the masthead ad
The asynchronously loaded desktop ad shifts the centered masthead content when it appears. Wrap the ad in a stable container and reserve its minimum height at medium viewports and above so the masthead keeps its initial position.
1 parent ff8866a commit f6cc0f2

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎site/src/components/home/MastHead.astro‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ import CodeCopy from '@components/shortcodes/CodeCopy.astro'
5050
<span class="d-none md:d-inline">&middot;</span>
5151
<a href="/docs/versions/" class="theme-secondary underline-50 underline-secondary text-nowrap">All releases</a>
5252
</div>
53-
<Ads />
53+
<div class="bd-masthead-ad">
54+
<Ads />
55+
</div>
5456
</div>
5557
</div>
5658
</div>

‎site/src/scss/_masthead.scss‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@
2828
background-color: transparent;
2929
}
3030

31-
#carbonads { // stylelint-disable-line selector-max-id
31+
.bd-masthead-ad {
32+
width: 100%;
3233
max-width: 400px;
3334
margin-block-start: 3rem;
35+
36+
@include media-breakpoint-up(md) {
37+
min-height: 160px;
38+
}
3439
}
3540

3641
@include media-breakpoint-up(md) {

0 commit comments

Comments
 (0)