svelte-ux icon indicating copy to clipboard operation
svelte-ux copied to clipboard

[AppLayout] Improve initial SSR layout

Open techniq opened this issue 2 years ago • 0 comments

Within AppLayout, since matchMedia() is used to determine if the menu drawer should be temporary (overlay) or persistent (side by side), and the navWidth is set via CSS variables, currently there is a layout shift (both on mobile (switch from persistent to temporary) and on desktop (setting nav width)).

We used to disable SSR rendering to bypass the issue by setting ssr: false in svelte.config.js, but this was replaced with a handle hook, which is still possible, but not as clean.

config.kit.ssr has been removed — use the handle hook instead: https://kit.svelte.dev/docs/hooks#handle'

techniq avatar Mar 31 '22 12:03 techniq