Skip to content
Draft
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
64 changes: 64 additions & 0 deletions app/assets/stylesheets/2017/views/_related_articles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#article .related-articles {
--_last-article-display: block;
--_related-article-min-width: 200px;

/* TODO */
max-width: clamp(1px, 960px, 960px);
margin: var(--border-size-xlarge) auto;
/* TODO */
padding: 0 clamp(1%, 2rem, 1%);

/* single column layout: width <= 640px */
@media screen and (max-width: 640px) {
--_related-article-min-width: 100%;
/* in single column we only show at most 2 related articles per category */
--_last-article-display: none;
}

h1 {
font-weight: 700;
font-size: 5rem;
margin-bottom: 3rem;
border-bottom: 1px solid currentColor;
}

.related-articles-category {
& > h2 {
font-weight: 500;
font-size: 3rem;
margin-bottom: 1.5rem;
}

&:not(:last-child) { margin-bottom: 3rem; }

.row {
display: flex;
flex-wrap: wrap;
justify-content: var(--_related-article-justification);
gap: clamp(10px, 1rem, 20px);

& > :last-child { display: var(--_last-article-display); }
}
}

.related-article {
flex: 1;
min-width: var(--_related-article-min-width);

img {
aspect-ratio: 16 / 9;
object-fit: cover;
width: 100%;
}

header {
text-wrap: balance;

h2 {
font-size: 2.25rem;
font-weight: 700;
padding: 1rem 0;
}
}
}
}
66 changes: 0 additions & 66 deletions app/assets/stylesheets/2017/views/_related_articles.scss

This file was deleted.

6 changes: 1 addition & 5 deletions app/views/2017/articles/_related.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
<% articles.each do |article| %>
<% article = article.preferred_localization %>

<% if article == articles.last %>
<div class="related-article column column-one-third third-related-article">
<% else %>
<div class="related-article column column-one-third">
<% end %>
<div class="related-article">

<% if article.image.present? && !lite_mode? %>
<%= link_to image_tag(article.image, class: "related-article-image", alt: article.image_description), article.path %>
Expand Down