Skip to content

Commit

Permalink
update logic around classlist
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusher committed Nov 9, 2023
1 parent 844b032 commit 9a55da2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions blocks/hero/hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 9a55da2

Please sign in to comment.