Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teaser block css fixes #134

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/134.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix Teaser block CSS. @danalvrz
4 changes: 2 additions & 2 deletions src/components/Blocks/Listing/GridTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const GridTemplate = ({ items, linkTitle, linkHref, isEditMode }) => {
componentName="PreviewImage"
item={item}
alt=""
className="grid-item-image"
className="item-image"
/>
)}
<div className="grid-item">
<div className="item">
<div className="content">
{item?.head_title && (
<div className="headline">{item.head_title}</div>
Expand Down
4 changes: 2 additions & 2 deletions src/theme/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ footer {
& > .block.heading .heading-wrapper,
& > .block.separator.has--align--full .line,
& > .block.introduction .block-container,
& > .block.teaser .grid-teaser-item.default,
& > .block.teaser .teaser-item.default,
& > .table-of-contents,
& > .slate blockquote {
@include default-container-width();
Expand Down Expand Up @@ -233,7 +233,7 @@ footer {
.block-editor-separator.has--align--full .block.separator,
.block-editor-separator .block.separator.has--align--full,
.block.teaser.has--align--center,
.block-editor-teaser .grid-teaser-item.default,
.block-editor-teaser .teaser-item.default,
.block-editor-toc {
@include default-container-width();
@include adjustMarginsToContainer($default-container-width);
Expand Down
10 changes: 9 additions & 1 deletion src/theme/blocks/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@
margin: 0.5rem !important;
}

.listing {
.block.listing {
h2 {
margin-bottom: 40px !important;
}
&.previous--is--same--block-type.previous--has--same--backgroundColor:not(.has--headline) {
margin-top: unset;
}
.listing-item,
.listing-item:last-child {
padding-bottom: 40px !important;
border-bottom: 1px solid $black !important;
}
}

.block-editor-empty {
Expand Down
11 changes: 6 additions & 5 deletions src/theme/blocks/_listing.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Listing Block
.block.listing {
.block.listing,
.column > .block.listing {
&.next--has--same--backgroundColor.next--is--same--block-type,
&.next--is--__button {
.listing-item:last-child {
Expand All @@ -13,7 +14,7 @@
border-bottom: 1px solid $black;
margin-bottom: 40px;

&:last-child:not(> .column) {
&:last-child {
padding-bottom: 0 !important;
border-bottom: none !important;
margin-bottom: 0;
Expand Down Expand Up @@ -62,7 +63,7 @@
aspect-ratio: $aspect-ratio;
}
h3 {
margin-bottom: 40px;
margin-bottom: 40px !important;
color: $black;
@include text-heading-h2();
}
Expand Down Expand Up @@ -138,13 +139,13 @@
}
}

img.grid-item-image {
img.item-image {
width: 100%;
margin: 0;
aspect-ratio: $aspect-ratio;
}

.grid-item {
.item {
margin-top: 40px;
}

Expand Down
24 changes: 12 additions & 12 deletions src/theme/blocks/_teaser.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
// We want the image to extend in all its container width
height: 100%;

.grid-teaser-item.default {
.teaser-item.default {
align-items: start;
padding-bottom: 40px; // same as vertical spacing in margin-bottom
border-bottom: 1px solid $black;
}

.grid-image-wrapper {
.image-wrapper {
width: 100%;
img {
object-position: center;
Expand All @@ -23,10 +23,10 @@

&.has--align--left,
&.has--align--right {
.grid-teaser-item.default {
.teaser-item.default {
display: flex;

.grid-image-wrapper {
.image-wrapper {
align-self: flex-start;
}

Expand All @@ -37,10 +37,10 @@
}

&.has--align--left {
.grid-teaser-item.default {
.teaser-item.default {
flex-direction: row;

.grid-image-wrapper {
.image-wrapper {
margin-right: 20px;

@media only screen and (max-width: $largest-mobile-screen) {
Expand All @@ -52,10 +52,10 @@
}

&.has--align--right {
.grid-teaser-item.default {
.teaser-item.default {
flex-direction: row-reverse;

.grid-image-wrapper {
.image-wrapper {
margin-left: 20px;

@media only screen and (max-width: $largest-mobile-screen) {
Expand All @@ -67,13 +67,13 @@
}

&.has--align--center {
.grid-teaser-item.default {
.teaser-item.default {
display: block;
a {
display: block;
}

.grid-image-wrapper {
.image-wrapper {
margin-bottom: 26px;
}
}
Expand Down Expand Up @@ -102,12 +102,12 @@

&.is--last--of--block-type,
&.next--has--different--backgroundColor {
.grid-teaser-item.default {
.teaser-item.default {
padding-bottom: 0;
border-bottom: none;
}
&.next--is--__button {
.grid-teaser-item.default {
.teaser-item.default {
padding-bottom: 40px;
border-bottom: 1px solid $black;
}
Expand Down