From e01036b83812b0b855f0dd46673d4e1455efe8bc Mon Sep 17 00:00:00 2001 From: SantiagoHomps-NC Date: Mon, 27 Nov 2023 10:55:05 -0300 Subject: [PATCH] adjustements --- blocks/v2-icon-cards/v2-icon-cards.css | 48 +++++++++++++++++++++++++- blocks/v2-icon-cards/v2-icon-cards.js | 7 ++-- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/blocks/v2-icon-cards/v2-icon-cards.css b/blocks/v2-icon-cards/v2-icon-cards.css index f59416f25..ce4c47e13 100644 --- a/blocks/v2-icon-cards/v2-icon-cards.css +++ b/blocks/v2-icon-cards/v2-icon-cards.css @@ -1,3 +1,11 @@ +.redesign-v2 .section .v2-icon-cards-wrapper { + padding: 0; +} + +.v2-icon-cards:not(.v2-icon-cards--4-cols) { + padding: var(--section-div-padding); +} + .v2-icon-cards__row { flex-direction: column; display: flex; @@ -110,4 +118,42 @@ padding: 20px 40px; background: var(--c-primary-white); } -} \ No newline at end of file +} + +.v2-icon-cards--4-cols .v2-icon-cards__column { + max-width: unset; + width: 100%; + gap: 0; + padding: 20px 40px; +} + +.v2-icon-cards--4-cols .v2-icon-cards__row { + gap: 0; +} + +.v2-icon-cards--4-cols .icon { + margin-bottom: 16px; +} + +.v2-icon-cards--4-cols .v2-icon-cards__heading { + font-size: 13px; + margin-bottom: 8px; +} + +.v2-icon-cards--4-cols .v2-icon-cards__body { + font-size: 13px; + margin-bottom: 0; +} + +.v2-icon-cards__column--extra-col .v2-icon-cards__body { + margin-bottom: 8px; + border-bottom: 1px solid var(--c-accent-copper); +} + +.v2-icon-cards--4-cols .v2-icon-cards__body:last-of-type { + margin-bottom: 0; +} + +.v2-icon-cards--4-cols .v2-icon-cards__column--extra-col { + background-color: var(--c-primary-gold); +} diff --git a/blocks/v2-icon-cards/v2-icon-cards.js b/blocks/v2-icon-cards/v2-icon-cards.js index ef062b5c1..2fcc9ab82 100644 --- a/blocks/v2-icon-cards/v2-icon-cards.js +++ b/blocks/v2-icon-cards/v2-icon-cards.js @@ -10,12 +10,13 @@ export default async function decorate(block) { row.classList.add(`${blockName}__row`); }); - // const hasExtraColumn = columns.length === 4; - if (columns.length === 4) block.classList.add(`${blockName}--4-cols`); + const hasExtraColumn = columns.length === 4; + if (hasExtraColumn) block.classList.add(`${blockName}--4-cols`); columns.forEach((col, idx) => { + const isExtraColumn = idx === 3; col.classList.add(`${blockName}__column`); - if (idx === 3) col.classList.add(`${blockName}__column--extra-col`); + if (isExtraColumn) col.classList.add(`${blockName}__column--extra-col`); const allTextElmts = col.querySelectorAll('p'); const bodyElmts = [];