Skip to content

Commit

Permalink
set unique font-size for news cards
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDiakite committed Aug 8, 2024
1 parent dc87265 commit e59e36a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/lib/components/NewsCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
const maxDescriptionLen = 150;
// If title is too long, decrease font size
const smallerTitle = () => {
if (post.meta.kind === 'meeting') return '';
if (post.meta.title.length > 50) return 'smaller-title';
else return '';
};
$: kind = post.meta.kind as 'blog' | 'event' | 'meeting';
// $: post.meta.slug ? null : encodeURIComponent
</script>
Expand All @@ -22,7 +15,7 @@
class={`post-card`}
>
<span class="document-tag">{$t(`card.${post.meta.kind}`)}</span>
<h1 class={`${smallerTitle()}`}>
<h1>
{#if kind === 'meeting'}
{$dateToLocalizedString(post.meta.date)}
{:else}
Expand Down Expand Up @@ -141,7 +134,8 @@
}
h1 {
font-size: 2rem;
font-size: 1.6rem;
line-height: 1.8rem;
text-decoration: underline;
text-decoration-thickness: 0.25rem;
text-decoration-color: transparent;
Expand Down

0 comments on commit e59e36a

Please sign in to comment.