You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'ad-slot-container--right-column',// float the ad to the right and sets max width and transparent background https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/lib/adStyles.ts#L161
156
-
!fullWidthGridBody&&'ad-slot-container--offset-right',// adds a negative margin to push the ad into the right rail, this isn't needed if the article body is full width
156
+
standardArticleGrid&&'ad-slot-container--offset-right',// adds a negative margin to push the ad into the right rail, this isn't needed if the article body is full width
* Checks if the article body is the full width of the article grid, which is the case for most interactive articles.
258
-
* Paragraphs are always the same width however, so when it's full width we don't need a negative margin to offset the ad into the right rail, `float: right` alone will suffice. (see addDesktopRightRailAds function)
* Determine whether the grid body is the full width of its parent container. If the grid body is full width, then we need to insert the ad without the offset right class, otherwise the ad will be pushed too far into the right hand column and could end up outside of the viewport.
271
+
* @param gridBodyWidth
272
+
* @param parentWidth
273
+
* @returns
274
+
*/
275
+
constisGridBodyFullWidthOfParent=(
276
+
gridBodyWidth: number,
277
+
parentWidth: number,
278
+
): boolean=>{
279
+
returngridBodyWidth>=parentWidth;
280
+
};
277
281
278
-
returnarticleBodWidth>=parentWidth;
279
-
});
282
+
/**
283
+
* Determine whether the grid body is the full width of the viewport. If the grid body is the full width of the viewport, then it's unlikely to have a right hand column, even if it does, it's probably using wacky styles that we can't easily work with, so we won't attempt to insert ads in this case.*
// If the grid body is the full width of the viewport, then it's unlikely to have a right hand column, even if it does, it's probably using wacky styles that we can't easily work with, so we won't attempt to insert ads in this case.
0 commit comments