shell: restructure layout to reduce importance of individual elements
This commit is contained in:
7 files changed
+36
-41
No files matched your search
+10
-1
@@ -31,6 +31,15 @@
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
<div
|
||||
style="
|
||||
display: contents;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
"
|
||||
>
|
||||
%sveltekit.body%
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
@@ -31,7 +30,12 @@
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<StickyCard class="w-full {clazz} text-slate-600 dark:text-zinc-400">
|
||||
<div
|
||||
class={[
|
||||
'w-full text-slate-600 dark:text-zinc-400 flex flex-col gap-4 text-sm',
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
{#if site.site.banner}
|
||||
<div
|
||||
class="rounded-xl
|
||||
@@ -145,4 +149,4 @@
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</StickyCard>
|
||||
</div>
|
||||
@@ -76,7 +76,6 @@
|
||||
import Entity from '$lib/components/ui/Entity.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { client, getClient } from '$lib/lemmy.svelte.js'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
@@ -146,7 +145,12 @@
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<StickyCard class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {clazz}">
|
||||
<div
|
||||
class={[
|
||||
'min-w-full pt-0 text-slate-600 dark:text-zinc-400 flex flex-col gap-4 text-sm',
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
<Entity
|
||||
name={community_view.community.title}
|
||||
label="!{fullCommunityName(
|
||||
@@ -337,4 +341,4 @@
|
||||
{/if}
|
||||
</Menu>
|
||||
</div>
|
||||
</StickyCard>
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
{@render children?.()}
|
||||
<div
|
||||
class={[
|
||||
'fixed bottom-0 lg:top-0',
|
||||
'fixed lg:sticky bottom-0 lg:top-0',
|
||||
!dockVisible && 'max-lg:-bottom-24',
|
||||
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
|
||||
'w-full z-50 pointer-events-none',
|
||||
@@ -53,22 +53,17 @@
|
||||
style: '',
|
||||
})}
|
||||
</div>
|
||||
<div
|
||||
class={[
|
||||
'content divide-x divide-slate-200/50 dark:divide-zinc-900 min-h-screen',
|
||||
settings.newWidth && 'limit-width',
|
||||
]}
|
||||
>
|
||||
<div class={['content flex-1', settings.newWidth && 'limit-width']}>
|
||||
{@render sidebar?.({
|
||||
class: `hidden md:flex sticky top-0 lg:top-16 left-0 h-max bg-slate-100 dark:bg-zinc-950 z-40`,
|
||||
class: `hidden md:flex sticky top-0 lg:top-16 left-0 h-max bg-slate-100 dark:bg-zinc-950 z-40 max-h-screen`,
|
||||
style: 'grid-area: sidebar; width: 100% !important;',
|
||||
})}
|
||||
{@render main?.({
|
||||
class: `w-full bg-slate-50 dark:bg-zinc-925 justify-self-center shadow-xs main max-lg:pb-22 lg:pt-20!`,
|
||||
class: `w-full bg-slate-50 dark:bg-zinc-925 justify-self-center border-x border-slate-200 dark:border-zinc-900 max-lg:pb-22`,
|
||||
style: 'grid-area: main',
|
||||
})}
|
||||
{@render suffix?.({
|
||||
class: `max-xl:hidden w-full sticky lg:top-20 h-max max-h-screen overflow-auto left-0 bg-slate-100 dark:bg-zinc-950 z-40`,
|
||||
class: `max-lg:hidden w-full sticky lg:top-16 h-max max-h-screen overflow-auto left-0 bg-slate-100 dark:bg-zinc-950 z-40`,
|
||||
style: 'grid-area: suffix;',
|
||||
})}
|
||||
</div>
|
||||
@@ -89,7 +84,7 @@
|
||||
max-width: 110rem;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
@media (min-width: 48rem) {
|
||||
.content {
|
||||
grid-template-columns: 16rem 1fr;
|
||||
justify-items: end start;
|
||||
@@ -97,7 +92,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
@media (min-width: 64rem) {
|
||||
.content {
|
||||
grid-template-columns: 20% 60% 20%;
|
||||
justify-items: end center start;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
pageHeader &&
|
||||
`w-[calc(100%+1.5rem)] sm:w-[calc(100%+3rem)]
|
||||
bg-slate-100 dark:bg-zinc-950 -m-3 sm:-m-6 mb-0 sm:mb-0 sm:p-6 p-4
|
||||
border-b border-slate-200/50 dark:border-zinc-800 margin`,
|
||||
border-b border-slate-200/50 dark:border-zinc-900 margin`,
|
||||
]}
|
||||
{style}
|
||||
>
|
||||
@@ -45,17 +45,3 @@
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.margin {
|
||||
margin-top: -12rem;
|
||||
padding-top: 12rem;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1024px) {
|
||||
.margin {
|
||||
margin-top: -8rem;
|
||||
padding-top: 8rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -27,10 +27,7 @@
|
||||
let { style = '', class: clazz = '' }: Props = $props()
|
||||
</script>
|
||||
|
||||
<nav
|
||||
class={['flex flex-col p-4 overflow-auto gap-1 h-fit max-h-screen', clazz]}
|
||||
{style}
|
||||
>
|
||||
<nav class={['flex flex-col overflow-auto gap-1', clazz]} {style}>
|
||||
{#if profile.current?.jwt}
|
||||
<SidebarButton icon={UserCircle} href="/profile">
|
||||
{#snippet label()}
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<ModalContainer />
|
||||
|
||||
{#snippet sidebar({ style: s, class: c })}
|
||||
<Sidebar class={c} style={s} />
|
||||
<Sidebar class={[c, 'p-3 sm:p-6']} style={s} />
|
||||
{/snippet}
|
||||
{#snippet main({ style: s, class: c })}
|
||||
<main
|
||||
@@ -134,10 +134,10 @@
|
||||
<Navbar class={c} style={s} />
|
||||
{/snippet}
|
||||
{#snippet suffix({ class: c, style: s })}
|
||||
<div class={c} style={s}>
|
||||
<div class={[c, 'p-3 sm:p-6']} style={s}>
|
||||
{#if page.data.slots?.sidebar?.component}
|
||||
{@const SvelteComponent = page.data.slots.sidebar.component}
|
||||
<SvelteComponent {...page.data.slots.sidebar.props} class="pt-0!" />
|
||||
<SvelteComponent {...page.data.slots.sidebar.props} />
|
||||
{:else if site.data}
|
||||
<SiteCard
|
||||
site={site.data.site_view}
|
||||
|
||||
Reference in new issue
Block a user