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>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div
|
||||||
|
style="
|
||||||
|
display: contents;
|
||||||
|
flex-direction: column;
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
%sveltekit.body%
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { userLink } from '$lib/lemmy/generic'
|
import { userLink } from '$lib/lemmy/generic'
|
||||||
import { settings } from '$lib/settings.svelte'
|
import { settings } from '$lib/settings.svelte'
|
||||||
@@ -31,7 +30,12 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</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}
|
{#if site.site.banner}
|
||||||
<div
|
<div
|
||||||
class="rounded-xl
|
class="rounded-xl
|
||||||
@@ -145,4 +149,4 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</StickyCard>
|
</div>
|
||||||
@@ -76,7 +76,6 @@
|
|||||||
import Entity from '$lib/components/ui/Entity.svelte'
|
import Entity from '$lib/components/ui/Entity.svelte'
|
||||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
|
||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import { client, getClient } from '$lib/lemmy.svelte.js'
|
import { client, getClient } from '$lib/lemmy.svelte.js'
|
||||||
import { errorMessage } from '$lib/lemmy/error'
|
import { errorMessage } from '$lib/lemmy/error'
|
||||||
@@ -146,7 +145,12 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</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
|
<Entity
|
||||||
name={community_view.community.title}
|
name={community_view.community.title}
|
||||||
label="!{fullCommunityName(
|
label="!{fullCommunityName(
|
||||||
@@ -337,4 +341,4 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
</StickyCard>
|
</div>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
'fixed bottom-0 lg:top-0',
|
'fixed lg:sticky bottom-0 lg:top-0',
|
||||||
!dockVisible && 'max-lg:-bottom-24',
|
!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',
|
'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',
|
'w-full z-50 pointer-events-none',
|
||||||
@@ -53,22 +53,17 @@
|
|||||||
style: '',
|
style: '',
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class={['content flex-1', settings.newWidth && 'limit-width']}>
|
||||||
class={[
|
|
||||||
'content divide-x divide-slate-200/50 dark:divide-zinc-900 min-h-screen',
|
|
||||||
settings.newWidth && 'limit-width',
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{@render sidebar?.({
|
{@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;',
|
style: 'grid-area: sidebar; width: 100% !important;',
|
||||||
})}
|
})}
|
||||||
{@render main?.({
|
{@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',
|
style: 'grid-area: main',
|
||||||
})}
|
})}
|
||||||
{@render suffix?.({
|
{@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;',
|
style: 'grid-area: suffix;',
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
@@ -89,7 +84,7 @@
|
|||||||
max-width: 110rem;
|
max-width: 110rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 48rem) {
|
||||||
.content {
|
.content {
|
||||||
grid-template-columns: 16rem 1fr;
|
grid-template-columns: 16rem 1fr;
|
||||||
justify-items: end start;
|
justify-items: end start;
|
||||||
@@ -97,7 +92,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1280px) {
|
@media (min-width: 64rem) {
|
||||||
.content {
|
.content {
|
||||||
grid-template-columns: 20% 60% 20%;
|
grid-template-columns: 20% 60% 20%;
|
||||||
justify-items: end center start;
|
justify-items: end center start;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
pageHeader &&
|
pageHeader &&
|
||||||
`w-[calc(100%+1.5rem)] sm:w-[calc(100%+3rem)]
|
`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
|
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}
|
{style}
|
||||||
>
|
>
|
||||||
@@ -45,17 +45,3 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</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()
|
let { style = '', class: clazz = '' }: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav
|
<nav class={['flex flex-col overflow-auto gap-1', clazz]} {style}>
|
||||||
class={['flex flex-col p-4 overflow-auto gap-1 h-fit max-h-screen', clazz]}
|
|
||||||
{style}
|
|
||||||
>
|
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
<SidebarButton icon={UserCircle} href="/profile">
|
<SidebarButton icon={UserCircle} href="/profile">
|
||||||
{#snippet label()}
|
{#snippet label()}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
<ModalContainer />
|
<ModalContainer />
|
||||||
|
|
||||||
{#snippet sidebar({ style: s, class: c })}
|
{#snippet sidebar({ style: s, class: c })}
|
||||||
<Sidebar class={c} style={s} />
|
<Sidebar class={[c, 'p-3 sm:p-6']} style={s} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet main({ style: s, class: c })}
|
{#snippet main({ style: s, class: c })}
|
||||||
<main
|
<main
|
||||||
@@ -134,10 +134,10 @@
|
|||||||
<Navbar class={c} style={s} />
|
<Navbar class={c} style={s} />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet suffix({ class: c, style: s })}
|
{#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}
|
{#if page.data.slots?.sidebar?.component}
|
||||||
{@const SvelteComponent = 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}
|
{:else if site.data}
|
||||||
<SiteCard
|
<SiteCard
|
||||||
site={site.data.site_view}
|
site={site.data.site_view}
|
||||||
|
|||||||
Reference in new issue
Block a user