Skip to content

Commit

Permalink
fix: Layout isses with articles
Browse files Browse the repository at this point in the history
  • Loading branch information
macx committed Apr 15, 2024
1 parent a1808a7 commit 25cbb1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/components/RelatedArticles.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const output = [...all, ...some, ...one, ...none]
<section class='related-articles'>
<h2 class='title-centered'>Lese als Nächstes</h2>

<div class='articles'>
<div class='l-articles'>
<ArticleCard article={output[0]} />
<ArticleCard article={output[1]} />
<ArticleCard article={output[2]} />
Expand All @@ -57,10 +57,4 @@ const output = [...all, ...some, ...one, ...none]
.related-articles {
margin-block-start: var(--sp-l);
}

.articles {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: var(--sp-content);
}
</style>
2 changes: 1 addition & 1 deletion src/pages/tutorials/[...page].astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function getStaticPaths({ paginate }: any) {
>
<h1>{title}</h1>
<Lead text={description} />
<section class='articles'>
<section class='l-articles'>
{articles.map((article: CollectionEntry<'tutorials'>) => (
<ArticleCard article={article} />
))}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tutorials/tags/[tag].astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const layout = 'wide'

{
posts.length > 0 ? (
<section class='articles'>
<section class='l-articles'>
{posts.map((post) => (
<ArticleCard article={post} />
))}
Expand Down
6 changes: 6 additions & 0 deletions src/styles/base/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,9 @@ main {
}
}
}

.l-articles {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: var(--sp-content);
}

0 comments on commit 25cbb1d

Please sign in to comment.