Skip to content

Commit

Permalink
Update styles on Shade Icon card variation. (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
bstopp authored Dec 19, 2023
1 parent b67ab37 commit fd9a8ba
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 13 deletions.
58 changes: 46 additions & 12 deletions blocks/cards/cards.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
width: 100%;
}

.cards.block.shade-icon {
margin-bottom: 40px;
}

.cards.block .title {
padding: 2em 0;
}
Expand Down Expand Up @@ -144,29 +140,39 @@
background-color: var(--light-grey);
}

.cards.block.shade-icon .cards-list {
gap: 70px;
max-width: 83.333%;
}

.cards.block.shade-icon .cards-list .cards-item {
background-color: var(--light-grey);
padding: 0;
border-top: 1px solid #000;
min-height: 274px;
align-items: center;
justify-content: center;
}

.cards.block.shade-icon .cards-list .cards-item .card-body h4 {
padding: 8px 30px;
text-align: center;
padding: 8px 0 20px;
font-weight: var(--font-weight-bold);
line-height: var(--line-height-l);
letter-spacing: var(--letter-spacing-m);
}

.cards.block.shade-icon .cards-list .cards-item .card-body p:not(:first-of-type) {
margin-bottom: 20px;
padding: 0 31px 34px;
font-size: var(--body-font-size-s);
}

.cards.block.shade-icon .cards-list .cards-item .card-body .icon {
display: block;
margin-top: 61px;
}

.cards.block.shade-icon .cards-list .cards-item .card-body .icon img {
margin: 0 auto;
display: block;
height: 35px;
width: 35px;
height: 45px;
width: 62px;
}

@media screen and (min-width: 600px) {
Expand All @@ -175,9 +181,21 @@
max-width: 83.333%;
}

.cards.block.shade-icon .cards-list {
flex-direction: row;
column-gap: 20px;
align-items: stretch;
margin-bottom: 50px;
}

.cards.block .cards-list .cards-item .card-body h3 {
font-size: var(--heading-font-size-m);
}

.cards.block.shade-icon .cards-list .cards-item .card-body p:not(:first-of-type) {
padding: 0 20px;
}

}

@media (min-width: 900px) {
Expand Down Expand Up @@ -217,4 +235,20 @@
align-items: stretch;
column-gap: 20px;
}

.cards.block.shade-icon .cards-list .cards-item .card-body p:not(:first-of-type) {
padding: 0 25px 54px;
}

}

@media (min-width: 1200px) {
.cards.block.shade-icon .cards-list {
justify-content: space-around;
column-gap: unset;
}

.cards.block.shade-icon .cards-list .cards-item {
flex: 0 1 28%;
}
}
2 changes: 1 addition & 1 deletion blocks/cards/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function decorate(block) {
const cards = [...block.children];

// Check for a title row
if (block.children[0].children.length === 1) {
if (!block.classList.contains('shade-icon') && block.children[0].children.length === 1) {
const wrapper = cards.shift();
const title = wrapper.children[0];
title.classList.add('title');
Expand Down

0 comments on commit fd9a8ba

Please sign in to comment.