ArticleTemplates/assets/scss/modules/_advert-slot.scss (178 lines of code) (raw):
// /*doc
// ---
// title: Advert slot
// name: advert-slot
// category: Modules
// ---
// Create a placeholder tp allow an advert to be placed with an article.
//
// MPU
//
// ```html_example
// <div class="advert-slot advert-slot--mpu">
// <div class="advert-slot__label">Advertisement</div>
// <div class="advert-slot__wrapper">
// <div class="advert-slot__wrapper__content">
// <!-- Advert injected here using JavaScript -->
// </div>
// </div>
// </div>
// ```
//
// */
.advert-slot {
@include meta();
color: color(brightness-46);
font-family: $guardian-sans;
background: color(brightness-93);
display: none;
overflow: auto;
div,
img {
vertical-align: middle;
}
.advert-slot__action {
color: color(brightness-46) !important;
background-image: none !important;
display: none;
padding-right: 30px;
position: absolute;
right: 0;
body[data-ads-enable-hiding='true'] & {
display: inline;
}
span[data-icon] {
font-size: 1.3em;
position: absolute;
right: 0;
top: -4px;
}
}
.advert-slot__action.test {
padding-right: 40px;
padding-top: 4px;
color: color(brightness-7) !important;
span[data-icon] {
color: color(brightness-7);
border: solid 1px color(brightness-60);
border-radius: 100%;
text-align: center;
width: 32px;
height: 32px;
display: inline-block;
right: 0px;
font-size: 16px;
top: -2px;
&::before {
line-height: 26px;
position: relative;
}
}
}
.advert-slot__wrapper {
position: relative;
overflow: hidden;
}
.advert-slot__wrapper__content {
position: absolute;
bottom: 0;
}
}
// MPU-size advert
.advert-slot--mpu {
border-top: 1px solid color(tone-sandy-light);
border-bottom: 1px solid color(tone-sandy-light);
display: block;
margin: 0 auto;
width: 300px;
@include mq($to: 560px) {
width: 100vw;
margin-left: base-px(-1);
}
@include mq($from: col2, $to: col3) {
width: 100%;
margin: 12px 0;
}
@include mq($from: col3) {
float: right;
margin: 0 -330px base-px(2) 24px;
clear: both;
}
.advert-slot__label {
height: 54px;
margin: 0 auto;
padding: base-px(1, 0, 1, 1);
width: 100%;
position: relative;
text-align: center;
.advert-slot__action {
right: base-px(1);
}
}
.advert-slot__wrapper {
height: 250px;
margin: 0 auto 16px auto;
padding-top: 250px;
@include mq($to: 560px) {
margin: 0 0 16px 0;
width: 100%;
}
@include mq($from: col2, $to: col3) {
margin-top: -24px;
}
@include mq($from: col3) {
margin-bottom: 0;
}
}
// The first ad slot is square on narrower breakpoints
.advert-slot__wrapper--1 {
@include mq($to: col3) {
height: 344px;
margin-left: auto;
margin-right: auto;
}
}
.advert-slot__wrapper.test__banner {
@include mq($from: col3) {
margin-bottom: 16px;
}
}
.advert-slot__wrapper.test {
@include mq($from: col2, $to: col3) {
margin-top: 0;
}
}
}
.ios {
.advert-slot--mpu {
.advert-slot__wrapper {
@include mq($from: col2, $to: col3) {
margin-left: calc(50% - 150px);
}
}
}
}
// This class hides the pre-inserted advert for subscribers
.advert-slot--false {
display: none !important;
}
// Special rules for adverts in liveblogs
.article--liveblog .article__body {
.advert-slot.advert-slot--mpu {
float: none;
margin: 0 auto;
position: static;
}
}
.garnett--type-media {
.advert-slot--mpu {
$whiteTwo: #dcdcdc;
$warmGrey: #767676;
$blackTwo: #333333;
border-top: solid 1px $warmGrey;
border-bottom: solid 1px $warmGrey;
background: $blackTwo;
color: $whiteTwo;
.advert-slot__action {
color: $whiteTwo !important;
}
}
}
.garnett--type-media[data-content-type='gallery'],
.is_advertising.garnett--type-guardianlabs[data-content-type='gallery'] {
.advert-slot--mpu {
margin: 0 0 32px 0;
@include mq($from: col2) {
clear: both;
position: relative;
top: auto;
margin-left: 8px;
margin-right: 8px;
width: calc(100% - 8px*2);
display: block;
.advert-slot__wrapper {
margin-left: calc(50% - 150px);
margin-top: -24px;
margin-bottom: 12px;
}
}
@include mq($from: col3) {
float: left;
width: calc(70% - #{$gs-unit}*2);
}
}
}