From 368ba6f02d88b0bb83d33d9073b9f4727a3aa496 Mon Sep 17 00:00:00 2001 From: Xylight Date: Sun, 15 Sep 2024 14:22:27 -0700 Subject: [PATCH] misc: only use compact style if screen size allows --- src/lib/components/lemmy/post/Post.svelte | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index 14957d93..b78d0dc3 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -85,7 +85,7 @@
.list-type { display: grid; grid-template-areas: 'meta media' 'title media' 'body media' 'embed embed' 'actions actions'; @@ -200,17 +200,24 @@ height: 100%; } + /* Swap media/item positions */ .list-type.left-align { grid-template-areas: 'media meta' 'media title' 'media body' 'embed embed' 'actions actions'; grid-template-columns: auto minmax(0, 1fr); } - .list-type.compact { - grid-template-areas: 'meta media' 'title media' 'body media' 'embed media' 'actions media'; + /* Has media on the right for all of them */ + @media (min-width: 480px) { + .list-type.compact { + grid-template-areas: 'meta media' 'title media' 'body media' 'embed media' 'actions media'; + } } - .list-type.compact.left-align { - grid-template-areas: 'media meta' 'media title' 'media body' 'media embed' 'media actions'; + /* Swap above again */ + @media (min-width: 480px) { + .list-type.compact.left-align { + grid-template-areas: 'media meta' 'media title' 'media body' 'media embed' 'media actions'; + } } :global(.compact > *:not(.no-list-margin):not(:first-child)) {