Try to prevent Carbon Ads from causing problems #798
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Problem
The initial problem was the horizontal scrollbar, reported in #793. This would appear below 1300px or 1367px width, depending on the page.
I've also tried to fix edge cases that could occur when the ad overlapped content. In the picture below, the text should not be obscured by the ad:
In this picture, the text
js
should be behind the ad but it is on top instead:Proposed Solution
I've removed the CSS from
Layout.vue
. That attempted to create a placeholder but it wasn't necessary. So long as the ad uses margins for positioning, rather than relative positioning, it will push text out of the way without needing the placeholder.I've bumped up the
z-index
to5
so that the ad appears in front of the language when it overlaps code examples. This is only applied conditionally so that it won't overlap the PWA popup.I've given the image a fixed width of
125px
. The Vue 2 docs seem to do the same thing. Without that the image has a width of130px
, which slightly overflows the box we've given it.I've changed the media query threshold from
1300px
to1376px
. That seems to be the correct value for switching modes.Layout.vue
already had it set to1376px
, though that code is now removed.I've made various small tweaks to the CSS to try to remove unnecessary code.