From 9a55da21817fc9f879a769d41a92ea5482ebc02e Mon Sep 17 00:00:00 2001 From: Rob Rusher Date: Thu, 9 Nov 2023 15:06:23 -0700 Subject: [PATCH] update logic around classlist --- blocks/hero/hero.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blocks/hero/hero.js b/blocks/hero/hero.js index 38ff163b..902603a8 100644 --- a/blocks/hero/hero.js +++ b/blocks/hero/hero.js @@ -66,8 +66,9 @@ export default async function decorate(block) { headlineWrapper.classList.add('headline'); filteredList.forEach((div) => { const nextElement = div.nextElementSibling; - if (div.innerHTML === 'Headline' || div.innerHTML === 'Description') nextElement.classList.add('title', 'desc'); - if (div.innerHTML === 'CTA') { + if (div.innerHTML.toLowerCase() === 'headline') nextElement.classList.add('title'); + else if (div.innerHTML.toLowerCase() === 'description') nextElement.classList.add('desc'); + else if (div.innerHTML.toLowerCase() === 'cta') { const button = document.createElement('p'); button.innerHTML = nextElement.innerHTML; button.classList.add('button-container');