Skip to content

Commit

Permalink
feat: SHIMMER - Update all post header images to use aspect ratio 16:9 (
Browse files Browse the repository at this point in the history
#42)

* feat: use aspect-ratio 16/9

* fix: featured slider aspect ratio

* fix safari aspect ratio

---------

Co-authored-by: evavirseda <[email protected]>
  • Loading branch information
begonaalvarezd and evavirseda authored Jul 28, 2023
1 parent 98eb699 commit 69062cd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
16 changes: 15 additions & 1 deletion src/sass/components/articles/_article-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,21 @@
background-color: var(--background-color);
overflow: hidden;
width: 100%;
padding-bottom: 50%;
aspect-ratio: 16/9;
}

@supports not (aspect-ratio: 16/9) {
.m-article-card__picture {
width: 100%;
overflow: hidden;
}

.m-article-card__picture{
content: "";
display: block;
padding-top: 56.25%;
}

}

.m-article-card__picture-link {
Expand Down
6 changes: 3 additions & 3 deletions src/sass/components/articles/_featured-slider.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.m-featured-slider {
position: relative;
overflow: hidden !important;
height: 350px;
height: calc(100vw * 9 / 16);
margin: -40px -#{$mobile-space} 40px;
@include transition(all 0.25s cubic-bezier(0.02, 0.01, 0.47, 1));
@include bs(var(--article-shadow-normal));
Expand All @@ -14,14 +14,14 @@
}

@include respond-to('medium') {
width: 100%;
width: calc(420px * 16 / 9);
height: 420px;
margin: -40px 10px 20px 10px;
border-radius: 0px;
}

@include respond-to('large') {
width: calc(100% - (100% / 3) - 40px);
width: calc(420px * 16 / 9);
margin: 0 20px 40px 20px;
overflow: unset;
}
Expand Down
21 changes: 19 additions & 2 deletions src/sass/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

.post-template .m-hero.with-picture {
min-height: unset;
padding: 0;
padding-bottom: 45%;
aspect-ratio: 16/9;
margin-top: 50px;
}

Expand All @@ -33,6 +32,24 @@
}
}

@supports not (aspect-ratio: 16/9) {
.post-template .m-hero.with-picture {
width: 100%;
overflow: hidden;
}

.post-template .m-hero.with-picture{
content: "";
display: block;
padding-top: 56.25%;
}

.post-template .m-hero.with-picture img {
object-fit: fill;
}

}

.disclamer-deprecated-post {
margin: 30px 0;
padding: 15px 20px;
Expand Down

0 comments on commit 69062cd

Please sign in to comment.