diff --git a/app/assets/stylesheets/components/stories.scss b/app/assets/stylesheets/components/stories.scss index 577b03a51..df15a11b0 100644 --- a/app/assets/stylesheets/components/stories.scss +++ b/app/assets/stylesheets/components/stories.scss @@ -54,17 +54,14 @@ // Cover section for promoted (first) card. &__cover { display: block; + width: 100%; + height: auto; + padding-bottom: 42%; + background-size: cover; + background-position: center center; - &__image { - width: 100%; - height: auto; - padding-bottom: 42%; - background-size: cover; - background-position: center center; - - @media (min-width: $breakpoint-m) { - border-radius: var(--radius) var(--radius) 0 0; - } + @media (min-width: $breakpoint-m) { + border-radius: var(--radius) var(--radius) 0 0; } } diff --git a/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap b/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap index a5f8a44a6..b2a4f174a 100644 --- a/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap +++ b/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap @@ -17,12 +17,14 @@ Object { -
+
-
+
{ href={article.path} className="crayons-story__cover" title={article.title} + style={{ backgroundImage: `url(${article.main_image})` }} > -
+ ); }; diff --git a/app/views/articles/_single_story.html.erb b/app/views/articles/_single_story.html.erb index 6b7812699..01dc0ea79 100644 --- a/app/views/articles/_single_story.html.erb +++ b/app/views/articles/_single_story.html.erb @@ -3,8 +3,9 @@
<% end %> <% if featured == true || (feed_style_preference == "rich" && story.main_image.present?) %> - -
+
+ <% end %>