Skip to content

Commit d47afcb

Browse files
fix(ArticleCard): enforce 16:9 aspect ratio (carbon-design-system#4794)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 055c96d commit d47afcb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/gatsby-theme-carbon/components/ArticleCard/article-card.scss

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@
6363
@include type-style('label-01');
6464
}
6565

66-
// At the moment, we force 16:9 for medium posts, this
67-
// is how we would force 16:9 for all article cards
68-
// .cds--article-card__img {
69-
// aspect-ratio: 16 / 9;
70-
// }
66+
// Enforce 16:9 for all article cards excluding those with gifs
67+
.cds--article-card__img {
68+
aspect-ratio: 16 / 9;
69+
}
70+
71+
.cds--article-card__img img:not([src$='.gif']),
72+
.cds--article-card__img span {
73+
width: 100%;
74+
height: 100%;
75+
object-fit: cover;
76+
}
7177

7278
.cds--article-card__img .gatsby-resp-image-wrapper {
7379
margin-bottom: 0;

0 commit comments

Comments
 (0)