-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppShells and Layouts #158
Comments
Hmm that's a bummer. Hopefully that's something they address. It would be hugely beneficial for this use case. FYI, see the Roadmap > Docs > Doc Refresh section here: Part of that first bullet is "improved layout". I was kind of expecting to handle setup for the Nav Bar and App Shell during the update to the Skeleton docs site. I essentially want to try and "dogfood" every component we can within the Docs site before we release it. This way we know it works well in a production environment. Given the issue you linked and the placement on the roadmap proposal, I'd say this one may be a ways out. But hopefully the named slot stuff is sorted by then! It may all work out. |
The alternative, however, would be to treat the App Shell like a component, rather than a layout for now. You have to import and set it up on each layout, but that may still be better than just rebuilding page layouts for scratch over and over. I'll think this about this! |
Linking this for reference later. I think something like this might be helpful for generating the AppShells layout structure: |
FYI this is still in progress but in order to use SvelteKit's routing group layouts I needed to update dependencies: |
Great progress made on this today! Notable improvements:
When I return to this I'll look to flush out the homepage a bit more. There's a couple links that need to be fixed, and I need to set it up to fetch the list of contributors and their avatars. GitHub provides an API for this, but I'll need to explore it a bit deeper - needs an auth token, etc. (NOTE: images removed, see the next update below) |
Here's a video showing the current layout for the homepage versus inner pages: General idea is the AppShell provides a ton of potential slots:
Here's the root layout markup: Versus the (inner) route group layout: Note the current AppShell will handle the "universal" style layout. This should handle MOST traditional layouts. However, it may be possible to add more exotic "shells" (read: layouts) with variant components in the future. |
Documentation added for the App Shell component. The props are pretty minimal on this one, but we may find cases where it'll be beneficial to add more. In case you're curious, here's how I'm hiding the left sidebar on the Homepage route: $: sidebarLeftWidth = $page.url.pathname === '/' ? 'w-0' : 'lg:w-auto'; <AppShell {sidebarLeftWidth}>...</AppShell> I'd welcome suggestions if you have any @niktek . |
Vitest integration cases have been added. I think with this the component is ready for QA! Please pull branch |
Re-opening this so QA can continue. |
FYI I constructed a simple Sveltekit app and implemented the AppShell, AppBar, and Drawer components. Everything worked as expected following the However I did run into two small issues... First, an ARIA Heading error log in the terminal when running
Second, I noted the Drawer "fly" animation is missing, which means the drawer only fades in rather than slide + fade. Compare the gifs of the Docs site animation version the test app using the package: I'll create/update tickets accordingly for these. |
Released as part of v0.37.32! |
Will be fleshing this out more - but with AppShells on the roadmap and also needing to revise my own site, I ran into the issue of svelte layouts not being able to have named slots as per sveltejs/kit#627 which also has implications for Skeleton offering a nice OOB DX.
The text was updated successfully, but these errors were encountered: