diff --git a/blocks/gnav/gnav.js b/blocks/gnav/gnav.js index 79054d8..edeff32 100644 --- a/blocks/gnav/gnav.js +++ b/blocks/gnav/gnav.js @@ -82,9 +82,7 @@ class Gnav { const brand = brandBlock.querySelector('a'); const { className } = brandBlock; - const classNameClipped = className.slice(0, -1); - const classNames = classNameClipped.split('--'); - brand.className = classNames.join(' '); + brand.className = className; if (brand.classList.contains('with-logo')) { brand.innerHTML = ''; const brandImg = document.createElement('img'); diff --git a/helix-version.txt b/helix-version.txt index 381119d..64ca703 100644 --- a/helix-version.txt +++ b/helix-version.txt @@ -1,2 +1,2 @@ -v6 +v7 diff --git a/scripts/scripts.js b/scripts/scripts.js index 43bff24..d65c9c4 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -428,7 +428,7 @@ export function decorateBlock(block) { if (!blockName) return; const section = block.closest('.section-wrapper'); if (section) { - section.classList.add(`${blockName}-container`.replace(/--/g, '-')); + section.classList.add(`${classes.join('-')}-container`); } const trimDashes = (str) => str.replace(/(^\s*-)|(-\s*$)/g, ''); const blockWithVariants = blockName.split('--');