<${carouselHeadingType} class="carousel-title ${variants}">${heading}${carouselHeadingType}>
+}
+
@@ -297,60 +296,60 @@ export default async function decorate(block) {
${carouselData
- .map(
- (carouselItem) => `
+ .map(
+ (carouselItem) => `
${
- createOptimizedPicture(
- carouselItem.image,
- carouselItem.imageAlt || carouselItem.title,
- false,
- isLarge
- ? [
- { media: "(max-width: 768px)", width: "1300" },
- { media: "(max-width: 1024px)", width: "1000" },
- { media: "(max-width: 1280px)", width: "1200" },
- { width: "1400" },
- ]
- : [
- { media: "(max-width: 768px)", width: "660" },
- { media: "(max-width: 1024px)", width: "1000" },
- { media: "(max-width: 1280px)", width: "560" },
- { width: "650" },
- ]
- ).outerHTML
- }
+ createOptimizedPicture(
+ carouselItem.image,
+ carouselItem.imageAlt || carouselItem.title,
+ false,
+ isLarge
+ ? [
+ { media: '(max-width: 768px)', width: '1300' },
+ { media: '(max-width: 1024px)', width: '1000' },
+ { media: '(max-width: 1280px)', width: '1200' },
+ { width: '1400' },
+ ]
+ : [
+ { media: '(max-width: 768px)', width: '660' },
+ { media: '(max-width: 1024px)', width: '1000' },
+ { media: '(max-width: 1280px)', width: '560' },
+ { width: '650' },
+ ],
+ ).outerHTML
+}
${
- !block.classList.contains("with-video") && carouselItem.rubric
- ? `
${carouselItem.rubric}`
- : ""
- }
+ !block.classList.contains('with-video') && carouselItem.rubric
+ ? `
${carouselItem.rubric}`
+ : ''
+}
${carouselItem.title}
- ${block.classList.contains("with-video") ? '
05:35
' : ""}
+ ${block.classList.contains('with-video') ? '
05:35
' : ''}
${
- isCourses && carouselItem.location
- ? `
${carouselItem.location}`
- : ""
- }
+ isCourses && carouselItem.location
+ ? `
${carouselItem.location}`
+ : ''
+}
${
- Array.isArray(carouselItem.awards) && carouselItem.awards.length
- ? `
${carouselItem.awards
- .map((award) => `- ${award}
`)
- .join("")}
`
- : ""
- }
+ Array.isArray(carouselItem.awards) && carouselItem.awards.length
+ ? `
${carouselItem.awards
+ .map((award) => `- ${award}
`)
+ .join('')}
`
+ : ''
+}
- `
- )
- .join("")}
+ `,
+ )
+ .join('')}
@@ -367,9 +366,9 @@ export default async function decorate(block) {
render(template, block);
// Post-processing
- removeEmptyElements(template, "p");
+ removeEmptyElements(template, 'p');
- block.innerHTML = "";
+ block.innerHTML = '';
block.append(...template.children);
});
diff --git a/blocks/full-bleed/full-bleed.css b/blocks/full-bleed/full-bleed.css
index f579e56..560a3b1 100644
--- a/blocks/full-bleed/full-bleed.css
+++ b/blocks/full-bleed/full-bleed.css
@@ -332,6 +332,10 @@
font-weight: 500;
}
+.full-bleed-wrapper .full-bleed.block .article-body strong a {
+ font-weight: 600;
+}
+
.full-bleed-wrapper .full-bleed.block .attribution a:hover {
text-decoration: underline;
}
diff --git a/blocks/gallery-listicle/gallery-listicle.css b/blocks/gallery-listicle/gallery-listicle.css
index 0b4399f..48f5578 100644
--- a/blocks/gallery-listicle/gallery-listicle.css
+++ b/blocks/gallery-listicle/gallery-listicle.css
@@ -89,6 +89,10 @@
line-height: 30px;
}
+.gallery-listicle-wrapper .gallery-listicle.block .headline p:first-of-type {
+ font-weight: 400;
+}
+
.gallery-listicle-wrapper .gallery-listicle.block .byline {
display: flex;
justify-content: flex-start;
@@ -131,14 +135,22 @@
text-decoration: none;
}
-.gallery-listicle-wrapper .gallery-listicle.block .article-body strong > a {
+.gallery-listicle-wrapper .gallery-listicle.block .article-body strong:not(:has(> *)) {
text-decoration: underline;
}
+.gallery-listicle-wrapper .gallery-listicle.block .article-body strong > a {
+ text-decoration: none;
+}
+
.gallery-listicle-wrapper .gallery-listicle.block .article-body > div a:hover {
color: var(--link-hover-color);
}
+.gallery-listicle-wrapper .gallery-listicle.block .article-body p > strong:only-child > a:only-child {
+ text-decoration: underline;
+}
+
.gallery-listicle-wrapper .gallery-listicle.block .publication {
display: flex;
align-items: baseline;
diff --git a/blocks/long-form/long-form.css b/blocks/long-form/long-form.css
index 49b9014..fb10888 100644
--- a/blocks/long-form/long-form.css
+++ b/blocks/long-form/long-form.css
@@ -1,5 +1,6 @@
.long-form-wrapper .long-form.block .container {
margin: 0 auto;
+
--article-width: 800px;
}
@@ -26,7 +27,6 @@
.long-form-wrapper .long-form.block .article-body a {
color: #000;
- /* text-decoration: none; */
font-weight: 500;
}
@@ -125,12 +125,17 @@
max-width: var(--article-width);
}
+.long-form-wrapper .long-form.block .article-body > div > div > div > div:has(iframe:not([src*="players.brightcove.net"])) {
+ max-width: none;
+ padding: 0;
+}
+
.long-form-wrapper .long-form.block .article-body h2 {
font-family: var(--font-tungsten);
font-size: 37px;
font-style: normal;
font-weight: 600;
- line-height: 38px;
+ line-height: 38px !important;
letter-spacing: .05em;
text-decoration: underline;
text-decoration-color: var(--link-hover-color);
@@ -157,6 +162,12 @@
}
}
+.long-form-wrapper .long-form.block .article-body p:has( > picture img ) {
+ width: 100vw;
+ max-width: none !important;
+ padding: 0 !important;
+}
+
.long-form-wrapper .long-form.block .headline .description p {
margin: 0;
}
@@ -359,19 +370,10 @@
margin-bottom: 0;
}
-.long-form-wrapper .long-form.block .article-body p:has( > picture img ) {
- width: 100vw;
- max-width: none !important;
- padding: 0 !important;
-}
-
.long-form-wrapper .long-form.block .article-body p > picture img {
position: relative;
background-color: #ededed;
width: 100vw;
object-fit: contain;
max-height: 850px;
- /* transform: translateX(-25vw); */
- /* transform: translateX(min(-20px, calc(363px - 50vw))); */
- /* transform: translateX(calc(363px - 25vw)); */
}
diff --git a/blocks/long-form/long-form.js b/blocks/long-form/long-form.js
index 878005f..3863134 100644
--- a/blocks/long-form/long-form.js
+++ b/blocks/long-form/long-form.js
@@ -9,17 +9,19 @@ import {
removeEmptyElements,
render,
replaceLinksWithEmbed,
-} from "../../scripts/scripts.js";
-import { buildBlock, decorateBlock, getMetadata, loadBlocks } from "../../scripts/lib-franklin.js";
+} from '../../scripts/scripts.js';
+import {
+ buildBlock, decorateBlock, getMetadata, loadBlocks,
+} from '../../scripts/lib-franklin.js';
/**
* @param {HTMLDivElement} block
*/
export default async function decorate(block) {
- const rubric = getMetadata("rubric");
+ const rubric = getMetadata('rubric');
const authors = getAuthors();
- const publicationDate = getMetadata("publication-date");
- const headlineMetadata = parseSectionMetadata(block.querySelector(".template-section-metadata"));
+ const publicationDate = getMetadata('publication-date');
+ const headlineMetadata = parseSectionMetadata(block.querySelector('.template-section-metadata'));
// HTML template in JS to avoid extra waterfall for LCP blocks
const HTML_TEMPLATE = `
@@ -40,11 +42,11 @@ export default async function decorate(block) {
By
${authors
- .map((author) => `
${author}`)
- .join(" and ")}
+ .map((author) => `
${author}`)
+ .join(' and ')}
- ${publicationDate ? '
' : ""}
+ ${publicationDate ? '
' : ''}
${publicationDate}
@@ -54,10 +56,10 @@ export default async function decorate(block) {
@@ -80,32 +82,32 @@ export default async function decorate(block) {
const template = parseFragment(HTML_TEMPLATE);
// Identify slots
- assignSlot(block, "heading", "h1");
- assignSlot(block, "image", "picture");
+ assignSlot(block, 'heading', 'h1');
+ assignSlot(block, 'image', 'picture');
- const description = [...block.querySelectorAll("h1 ~ p")].find((p) => !p.querySelector("picture"));
+ const description = [...block.querySelectorAll('h1 ~ p')].find((p) => !p.querySelector('picture'));
if (description) {
- description.setAttribute("slot", "description");
+ description.setAttribute('slot', 'description');
}
// Pre-processing
- block.querySelectorAll(".template-section-metadata").forEach((metadataEl) => {
+ block.querySelectorAll('.template-section-metadata').forEach((metadataEl) => {
const section = metadataEl.parentElement;
const sectionMetadata = parseSectionMetadata(metadataEl);
if (sectionMetadata.photoCredit) {
- const picture = section.querySelector("picture");
+ const picture = section.querySelector('picture');
if (picture) {
- picture.insertAdjacentHTML("afterend", `
${sectionMetadata.photoCredit}
`);
+ picture.insertAdjacentHTML('afterend', `
${sectionMetadata.photoCredit}
`);
}
}
});
- block.querySelectorAll(":scope > div > div > div:not(:first-of-type):not(:last-of-type)").forEach((section) => {
- section.append(document.createElement("hr"));
+ block.querySelectorAll(':scope > div > div > div:not(:first-of-type):not(:last-of-type)').forEach((section) => {
+ section.append(document.createElement('hr'));
});
- const share = buildBlock("social-share", { elems: [] });
- share.setAttribute("slot", "share");
+ const share = buildBlock('social-share', { elems: [] });
+ share.setAttribute('slot', 'share');
block.append(share);
replaceLinksWithEmbed(block);
@@ -114,49 +116,49 @@ export default async function decorate(block) {
render(template, block, ARTICLE_TEMPLATES.LongForm);
// Post-processing
- removeEmptyElements(template, "p");
- template.querySelector(".article-body div > p").classList.add("highlight");
+ removeEmptyElements(template, 'p');
+ template.querySelector('.article-body div > p').classList.add('highlight');
- const pictures = template.querySelectorAll(".article-body p > picture");
+ const pictures = template.querySelectorAll('.article-body p > picture');
addPhotoCredit(pictures);
// Update block with rendered template
- block.innerHTML = "";
+ block.innerHTML = '';
block.append(template);
// Inner block loading
block
- .querySelectorAll(".social-share, .embed, .more-cards, .courses")
+ .querySelectorAll('.social-share, .embed, .more-cards, .courses')
.forEach((innerBlock) => decorateBlock(innerBlock));
- loadBlocks(document.querySelector("main"));
+ loadBlocks(document.querySelector('main'));
// Toggle dark theme on scroll
- const article = block.querySelector(".article-content");
+ const article = block.querySelector('.article-content');
requestAnimationFrame(() => {
new IntersectionObserver((entries) => {
const { bottom, top } = entries[0].boundingClientRect;
const viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
- article.classList.toggle("dark", !(bottom < 0 || top - viewHeight >= 0));
- }).observe(block.querySelector(".lead .image"));
+ article.classList.toggle('dark', !(bottom < 0 || top - viewHeight >= 0));
+ }).observe(block.querySelector('.lead .image'));
});
// creating auto carousels
const autoCarouselGroups = [];
const potentialArticleImageGroups = block.querySelectorAll(
- ".article-body *:not(:has(picture)) + p:has(> picture img)"
+ '.article-body *:not(:has(picture)) + p:has(> picture img)',
);
potentialArticleImageGroups.forEach((imageParagraph) => {
// this element is followed by at least 2 other images
if (
- imageParagraph.nextElementSibling.querySelector("picture > img") &&
- imageParagraph.nextElementSibling.nextElementSibling.querySelector("picture > img")
+ imageParagraph.nextElementSibling.querySelector('picture > img')
+ && imageParagraph.nextElementSibling.nextElementSibling.querySelector('picture > img')
) {
const imageGroup = [];
let nextElementToProcess = imageParagraph;
while (nextElementToProcess) {
- const hasImage = nextElementToProcess.querySelector("picture > img");
+ const hasImage = nextElementToProcess.querySelector('picture > img');
if (hasImage) {
imageGroup.push(nextElementToProcess);
nextElementToProcess = nextElementToProcess.nextElementSibling;
@@ -170,8 +172,8 @@ export default async function decorate(block) {
autoCarouselGroups.forEach((imageArray) => {
const prevNode = imageArray[0].previousSibling;
- const autoCarouselBlock = buildBlock("carousel", { elems: imageArray });
- autoCarouselBlock.classList.add("auto-carousel");
+ const autoCarouselBlock = buildBlock('carousel', { elems: imageArray });
+ autoCarouselBlock.classList.add('auto-carousel');
prevNode.parentElement.insertBefore(autoCarouselBlock, prevNode.nextElementSibling);
decorateBlock(autoCarouselBlock);
});
diff --git a/blocks/more-cards/more-cards.css b/blocks/more-cards/more-cards.css
index 3b888b2..43bfb3f 100644
--- a/blocks/more-cards/more-cards.css
+++ b/blocks/more-cards/more-cards.css
@@ -5,6 +5,10 @@
justify-content: center;
}
+.more-cards a {
+ text-decoration: none;
+}
+
.more-cards.multiple {
background-color: #f6f6f6;
}
diff --git a/blocks/product-listing/product-listing.css b/blocks/product-listing/product-listing.css
index 4fd117d..27bcec1 100644
--- a/blocks/product-listing/product-listing.css
+++ b/blocks/product-listing/product-listing.css
@@ -102,7 +102,7 @@
}
.product-listing-wrapper .product-listing.block .article-content .details .separator,
-.product-listing-wrapper .product-listing.block .article-content .details .separator + span {
+.product-listing-wrapper .product-listing.block .article-content .details .advertiser {
color: #adb4b7;
}
diff --git a/blocks/product-listing/product-listing.js b/blocks/product-listing/product-listing.js
index 97552ce..f208a2a 100644
--- a/blocks/product-listing/product-listing.js
+++ b/blocks/product-listing/product-listing.js
@@ -42,7 +42,7 @@ export default async function decorate(block) {
diff --git a/scripts/scripts.js b/scripts/scripts.js
index a2f4bb8..2625269 100644
--- a/scripts/scripts.js
+++ b/scripts/scripts.js
@@ -32,7 +32,11 @@ const range = document.createRange();
export function replaceLinksWithEmbed(block) {
const embeds = ['youtube', 'brightcove', 'instagram', 'ceros'];
- block.querySelectorAll(embeds.map((embed) => `a[href*="${embed}"]`).join(',')).forEach((embedLink) => {
+ block.querySelectorAll(embeds.map((embed) => `a:only-child[href*="${embed}"]`).join(',')).forEach((embedLink) => {
+ // do not transform links that are inline
+ if (embedLink.innerText !== embedLink.parentElement.innerText) {
+ return;
+ }
if (embedLink.textContent.startsWith('View') && embedLink.href.includes('instagram')) {
embedLink.remove();
} else {
@@ -879,4 +883,3 @@ export const generateArticleBlocker = (block, selector) => {
articleBody.appendChild(articleBlocker);
};
-