diff --git a/libs/blocks/hero-marquee/hero-marquee.css b/libs/blocks/hero-marquee/hero-marquee.css index 34c9175a3f..f81a551f33 100644 --- a/libs/blocks/hero-marquee/hero-marquee.css +++ b/libs/blocks/hero-marquee/hero-marquee.css @@ -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); } @@ -150,6 +151,12 @@ html[dir="rtl"] .hero-marquee .foreground { display: none; } +div[class*='-up'] .hero-marquee.has-bg.full-width, +div[class*='-up'] .hero-marquee.has-bg.grid-full-width { + padding-left: 0; + padding-right: 0; +} + /* Row Types */ .hero-marquee .row-list { text-align: left; diff --git a/libs/blocks/hero-marquee/hero-marquee.js b/libs/blocks/hero-marquee/hero-marquee.js index 91a0499e68..65772f5431 100644 --- a/libs/blocks/hero-marquee/hero-marquee.js +++ b/libs/blocks/hero-marquee/hero-marquee.js @@ -122,6 +122,7 @@ function extendButtonsClass(copy) { button.classList.add('button-xl', 'button-justified-mobile'); }); } + function parseKeyString(str) { const regex = /^(\w+)\s*\((.*)\)$/; const match = str.match(regex); @@ -164,14 +165,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.querySelector('picture', 'video')) { + 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(); diff --git a/test/blocks/hero-marquee/mocks/body.html b/test/blocks/hero-marquee/mocks/body.html index 72166c8f81..247fb1b817 100644 --- a/test/blocks/hero-marquee/mocks/body.html +++ b/test/blocks/hero-marquee/mocks/body.html @@ -17,8 +17,12 @@
-
con-block-row-lockup (xl-icon-size)
-
XL Icon Size
+
con-block-row-lockup (xl-icon)
+
XL Icon
+
+
+
con-block-row-lockup
+
default size
@@ -30,7 +34,7 @@

This Hero has all row types

-
con-block-row-list (max-width-6-tablet)
+
con-block-row-list (max-width-6-tablet, xl-body)
+ +
+
+
+
+
+
+

Hero w/ empty bg row

+
+

This is the body

+
+
+ +
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+

Hero w/ bg elements

+
+

This is the body

+
+