From a566c550572e59b6341137a8d51ac28eec5a4b3f Mon Sep 17 00:00:00 2001
From: Olivia206 <olivia.simonet@mmibordeaux.com>
Date: Tue, 2 Aug 2022 18:44:12 +0200
Subject: [PATCH] Layout horizontal for posts

---
 assets/sass/_theme/_configuration.sass |  3 +++
 assets/sass/_theme/_utils.sass         | 23 +++++++++++++++++++++++
 assets/sass/_theme/sections/posts.sass | 11 ++++++++---
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass
index c4e2aecc..b5d689bf 100644
--- a/assets/sass/_theme/_configuration.sass
+++ b/assets/sass/_theme/_configuration.sass
@@ -202,6 +202,9 @@ $program-share-font-size: $h5-size !default
 $program-share-font-size-md: $h5-size-md !default
 $program-zindex-toc: $zindex-toc !default
 
+// Layout posts list
+$posts-list-horizontal: false !default
+
 // MISC
 
 // Animations
diff --git a/assets/sass/_theme/_utils.sass b/assets/sass/_theme/_utils.sass
index 41f38254..e095fb63 100644
--- a/assets/sass/_theme/_utils.sass
+++ b/assets/sass/_theme/_utils.sass
@@ -199,3 +199,26 @@
         @include icon($icon, after)
             font-size: px2rem(20) 
             margin-left: px2rem(10)
+
+
+@mixin layout-posts
+    @if $posts-list-horizontal
+        .posts 
+            @include grid(1)
+            grid-gap: 0
+            > div 
+                border-bottom: 1px solid $main-border-color
+                margin-bottom: $spacing3
+                padding-bottom: $spacing3
+                .post
+                    @include grid(4, md)
+                    flex-direction: row
+                    div:first-child
+                        width: col(24)
+                    time 
+                        font-size: $h5-size
+                        position: absolute
+                        right: 0
+                        top: 0
+                    .media
+                        margin: 0
\ No newline at end of file
diff --git a/assets/sass/_theme/sections/posts.sass b/assets/sass/_theme/sections/posts.sass
index 565480f0..63ab64db 100644
--- a/assets/sass/_theme/sections/posts.sass
+++ b/assets/sass/_theme/sections/posts.sass
@@ -15,9 +15,14 @@
         font-size: px2rem(14)
 
 .posts
-    @include grid(1)
-    @include grid(2, md)
-    @include grid(3, xl)
+        @include grid(1)
+        @include grid(2, md)
+        @include grid(3, xl)
+
+.posts__section
+    @include layout-posts
+    .hero
+        margin-bottom: $spacing4
 
 .post-categories
     @include list-reset
-- 
GitLab