@@ -22,7 +22,9 @@ type IndexedSlot =
2222 | 'fronts-banner'
2323 | 'liveblog-inline'
2424 | 'liveblog-inline-mobile'
25- | 'mobile-front' ;
25+ | 'mobile-front'
26+ | 'gallery-inline'
27+ | 'gallery-inline-mobile' ;
2628
2729// TODO move to commercial
2830type SlotNamesWithPageSkin = SlotName | 'pageskin' ;
@@ -424,6 +426,29 @@ const crosswordBannerMobileAdStyles = css`
424426 min-height : ${ getMinHeight ( adSizes . mobilesticky . height ) } px;
425427` ;
426428
429+ const galleryInlineAdStyles = css `
430+ margin : ${ space [ 3 ] } px auto;
431+ min-height : ${ getMinHeight ( adSizes . mpu . height ) } px;
432+
433+ & .ad-slot--fluid {
434+ margin : ${ space [ 3 ] } px auto;
435+ }
436+ ` ;
437+
438+ /*** The top-above-nav-mobile and inline slots label should be dark even in light mode.
439+ * Other slots will stay the same as the mentioned ad slots are
440+ * the only ones to overlay the dark section of Gallery pages.
441+ */
442+ const galleryInlineAdLabelStyles = css `
443+ .ad-slot--dark [data-label-show = 'true' ]: not (
444+ .ad-slot--interscroller
445+ )::before {
446+ background-color : ${ schemedPalette ( '--ad-background-article-inner' ) } ;
447+ border-top-color : ${ schemedPalette ( '--ad-border-article-inner' ) } ;
448+ color : ${ schemedPalette ( '--ad-labels-text-article-inner' ) } ;
449+ }
450+ ` ;
451+
427452const AdSlotWrapper = ( {
428453 children,
429454 css : additionalCss ,
@@ -911,6 +936,57 @@ export const AdSlot = ({
911936 </ AdSlotWrapper >
912937 ) ;
913938 }
939+ case 'gallery-inline' : {
940+ const advertId = `inline${ index + 1 } ` ;
941+ return (
942+ < AdSlotWrapper css = { [ labelStyles , galleryInlineAdLabelStyles ] } >
943+ < div
944+ id = { `dfp-ad--${ advertId } ` }
945+ className = { [
946+ 'js-ad-slot' ,
947+ 'ad-slot' ,
948+ `ad-slot--${ advertId } ` ,
949+ 'ad-slot--gallery-inline' ,
950+ 'ad-slot--dark' ,
951+ 'hide-until-tablet' ,
952+ 'ad-slot--rendered' ,
953+ ] . join ( ' ' ) }
954+ css = { galleryInlineAdStyles }
955+ data-link-name = { `ad slot ${ advertId } ` }
956+ data-name = { advertId }
957+ aria-hidden = "true"
958+ data-label-show = "true"
959+ data-testid = "slot"
960+ />
961+ </ AdSlotWrapper >
962+ ) ;
963+ }
964+ case 'gallery-inline-mobile' : {
965+ const advertId = index === 0 ? 'top-above-nav' : `inline${ index } ` ;
966+ return (
967+ < AdSlotWrapper css = { [ labelStyles , galleryInlineAdLabelStyles ] } >
968+ < div
969+ id = { `dfp-ad--${ advertId } --mobile` }
970+ className = { [
971+ 'js-ad-slot' ,
972+ 'ad-slot' ,
973+ `ad-slot--${ advertId } ` ,
974+ 'ad-slot--gallery-inline' ,
975+ 'ad-slot--dark' ,
976+ 'ad-slot--mobile' ,
977+ 'mobile-only' ,
978+ 'ad-slot--rendered' ,
979+ ] . join ( ' ' ) }
980+ css = { galleryInlineAdStyles }
981+ data-link-name = { `ad slot ${ advertId } ` }
982+ data-name = { advertId }
983+ aria-hidden = "true"
984+ data-label-show = "true"
985+ data-testid = "slot"
986+ />
987+ </ AdSlotWrapper >
988+ ) ;
989+ }
914990 }
915991} ;
916992
0 commit comments