-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Netcentric/23-card-block
23 card block
- Loading branch information
Showing
7 changed files
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
main .section.v2-cards-container .v2-cards-wrapper { | ||
padding: 0; | ||
} | ||
|
||
.v2-cards { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
padding: 16px; | ||
justify-content: center; | ||
max-width: var(--wrapper-width); | ||
margin: auto; | ||
} | ||
|
||
.v2-cards__card-item { | ||
background: var(--c-primary-white); | ||
color: var(--c-primary-black); | ||
} | ||
|
||
.v2-cards__picture-wrapper { | ||
padding: 0; | ||
} | ||
|
||
.v2-cards__text-wrapper { | ||
padding: 24px; | ||
} | ||
|
||
.v2-cards__picture { | ||
display: flex; | ||
} | ||
|
||
.v2-cards__image { | ||
background: var(--c-tertiary-light-cool-gray); | ||
aspect-ratio: 16/9; | ||
width: 100%; | ||
object-fit: cover; | ||
} | ||
|
||
.v2-cards__heading { | ||
font-family: var(--ff-subheadings-medium); | ||
font-size: var(--headline-5-font-size); | ||
line-height: var(--headline-5-line-height); | ||
margin: 0 0 7px; | ||
} | ||
|
||
.v2-cards__text-wrapper p { | ||
margin: 0; | ||
color: var(--c-primary-black); | ||
font-family: var(--ff-body); | ||
font-size: var(--body-1-font-size); | ||
font-style: normal; | ||
line-height: var(--body-1-line-height); | ||
letter-spacing: 0.16px; | ||
} | ||
|
||
.v2-cards__text-wrapper .v2-cards__button-container { | ||
margin-top: 16px; | ||
} | ||
|
||
.v2-cards__button-container .v2-cards__button:any-link { | ||
align-items: flex-start; | ||
} | ||
|
||
.v2-cards__button-container .icon { | ||
stroke: currentcolor; | ||
width: 16px; | ||
height: 16px; | ||
} | ||
|
||
.v2-cards__button-container .icon svg { | ||
width: 16px; | ||
height: 16px; | ||
} | ||
|
||
@media (min-width: 744px) { | ||
.v2-cards { | ||
flex-flow: row wrap; | ||
gap: 16px; | ||
padding: 0; | ||
justify-content: center; | ||
} | ||
|
||
.v2-cards__card-item { | ||
max-width: calc((100% - 32px) / 3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const blockClass = 'v2-cards'; | ||
|
||
export default async function decorate(block) { | ||
const cardsItems = [...block.querySelectorAll(':scope > div')]; | ||
cardsItems.forEach((el) => el.classList.add(`${blockClass}__card-item`)); | ||
|
||
const cardsSections = [...block.querySelectorAll(':scope > div > div')]; | ||
cardsSections.forEach((el) => { | ||
el.classList.add(`${blockClass}__text-wrapper`); | ||
}); | ||
|
||
const pictures = [...block.querySelectorAll('picture')]; | ||
pictures.forEach((el) => { | ||
el.classList.add(`${blockClass}__picture`); | ||
el.parentElement.classList.add(`${blockClass}__picture-wrapper`); | ||
el.parentElement.classList.remove(`${blockClass}__text-wrapper`); | ||
}); | ||
|
||
const images = [...block.querySelectorAll('img')]; | ||
images.forEach((el) => el.classList.add(`${blockClass}__image`)); | ||
|
||
const cardsHeadings = [...block.querySelectorAll('h1, h2, h3, h4, h5, h6')]; | ||
cardsHeadings.forEach((el) => el.classList.add(`${blockClass}__heading`)); | ||
|
||
const buttons = [...block.querySelectorAll('.button-container')]; | ||
buttons.forEach((el) => { | ||
el.classList.add(`${blockClass}__button-container`); | ||
[...el.querySelectorAll('a')].forEach((link) => { | ||
link.classList.add('standalone-link', `${blockClass}__button`); | ||
link.classList.remove('button', 'button--primary'); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters