refining card news with dates and proportions sizes

This commit is contained in:
Antoine M 2023-11-16 16:26:28 +01:00
parent 8093021764
commit 412e71633f
2 changed files with 18 additions and 13 deletions

View File

@ -23,7 +23,7 @@
/* @apply h-full ; */ /* @apply h-full ; */
} }
&__heading { &__heading {
@apply flex flex-col-reverse; @apply flex flex-col !mb-6;
} }
&__tag { &__tag {
@ -44,7 +44,7 @@
} }
&__title { &__title {
@apply text-2xl font-bold mb-4 text-secondary; @apply text-lg font-bold text-secondary mb-1;
line-height: 1.1; line-height: 1.2;
} }
} }

View File

@ -3,23 +3,28 @@
$card_variant = $args['card_variant']; $card_variant = $args['card_variant'];
$post_thumbnail = $args['post_thumbnail']; $post_thumbnail = $args['post_thumbnail'];
$post_title = $args['post_title']; $post_title = $args['post_title'];
$post_date = $args['post_date'] ?? null;
$news_type = $args['news_type'] ?? null; $news_type = $args['news_type'] ?? null;
$thematique = $args['thematique'] ?? null; $thematique = $args['thematique'] ?? null;
$mainThematique = getMainThematique($thematique) ?? null; $mainThematique = getMainThematique($thematique) ?? null;
?> ?>
<div class="card-news <?php echo $card_variant ? 'card-news--' . $card_variant : '' ?> "> <div class="card-news <?php echo $card_variant ? 'card-news--' . $card_variant : '' ?> ">
<?php echo $post_thumbnail ?> <?php echo $post_thumbnail ?>
<div class="card-news__inner"> <div class="card-news__inner">
<div class="card-news__heading"> <div class="card-news__heading">
<h3 class="card-news__title"><?php echo $post_title ?></h3>
<?php if ($news_type) : ?> <?php if ($news_type) : ?>
<p class="card-news__tag"><?php echo $news_type[0]->name ?></p> <p class="card-news__tag"><?php echo $news_type[0]->name ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ($thematique) : ?> <?php if ($thematique) : ?>
<p class="card-news__thematique-tag card-news__thematique-tag--<?php echo $mainThematique->slug ?>"><?php echo $thematique->name ?></p> <p class="card-news__thematique-tag card-news__thematique-tag--<?php echo $mainThematique->slug ?>"><?php echo $thematique->name ?></p>
<?php endif; ?> <?php endif; ?>
<h3 class="card-news__title"><?php echo $post_title ?></h3>
<?php if ($post_date) : ?>
<p class="card-news__post-date card-news__post-date"><?php echo $post_date ?></p>
<?php endif; ?>
</div> </div>
<a href=" <?php echo get_the_permalink($post_ID) ?>" class="cta cta--read-more cta--with-arrow-button cta--streched "> <a href=" <?php echo get_the_permalink($post_ID) ?>" class="cta cta--read-more cta--with-arrow-button cta--streched ">