Skip to content

Commit

Permalink
MWPW-157888 - Hero marquee w/ no-min-height and no l/r padding when…
Browse files Browse the repository at this point in the history
… using a `full-width` variant (#2861)

* stub no-min-height

* fixed hero has-bg logic
  • Loading branch information
ryanmparrish authored Sep 17, 2024
1 parent d4134c8 commit eb788ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions libs/blocks/hero-marquee/hero-marquee.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
align-items: center;
}

.hero-marquee.no-min-height { min-height: unset; }
.hero-marquee.s-min-height { min-height: var(--s-min-height); }
.hero-marquee.l-min-height { min-height: var(--l-min-height); }

Expand Down
10 changes: 6 additions & 4 deletions libs/blocks/hero-marquee/hero-marquee.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,16 @@ function loadBreakpointThemes() {
export default async function init(el) {
el.classList.add('con-block');
let rows = el.querySelectorAll(':scope > div');
if (rows.length > 1 && rows[0].textContent !== '') {
if (rows.length <= 1) return;
const [head, ...tail] = rows;
rows = tail;
if (head.textContent.trim() === '') {
head.remove();
} else {
el.classList.add('has-bg');
const [head, ...tail] = rows;
handleObjectFit(head);
decorateBlockBg(el, head, { useHandleFocalpoint: true });
rows = tail;
}

// get first row that's not a keyword key/value row
const mainRowIndex = rows.findIndex((row) => {
const firstColText = row.children[0].textContent.toLowerCase().trim();
Expand Down

0 comments on commit eb788ce

Please sign in to comment.