-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Sidebar push content option instead of overlay #637
Comments
Hey Jord, I'd have to think about this one. You might take a look at the upcoming changes to the drawer here: Now that the store will be built in for the drawer, it might be possible to listen to that. When it has a value you would use CSS transition class for As for building it into the drawer, perhaps, but I'll need to experiment with it. Currently the Drawer lives outside of the flow of say, the AppShell, so the tricky bit will figuring out how to communicate between the drawer and page itself. Perhaps |
Note that we do have a table of contents component planned: But in our docs it would live on the right, and probably be inaccessible on mobile, ala Mantine: |
@jordharr I've given some thought to implementing this feature as part of my audit here: Unfortunately I don't think this will be something we implement on our side at this time. To facilitate this, we would need to apply a translate style to our surrounding page elements, such as our body. Paired with a transition animation this should look pretty good. Unfortunately applying this to the body affects the drawer placement itself as well, leaving this big ugly gap on the left side: <body class="translate-x-[50%]"> Instead, we would need to adjust something like the AppShell component - if folks opt to use this: <AppShell ... class="translate-x-[50%]"> But this comes with two gotchas:
Additionally, by default, drawers appear to be attached to three edges of the screen at a time. But with style overrides can actually be "free floating", showing the content behind the drawer (see the mocks below). By doing this, this large empty area left of the AppShell would be visible and look broken. Given this, I think the best case is to leave this up to devs to implement this themselves on a case-by-case basis. But, the good news is that it isn't terribly difficult. You need only do two things:
Here's a quick example: $: positionClasses = $drawerStore.open && $drawerStore.position === 'left' ? 'translate-x-[50%]' : ''; Then on the AppShell itself: <AppShell class="transition-transform {positionClasses}"> And here's the result. Note this is hardcoded for left position drawers, but with some additional logic could support any position. Kapture.2023-02-08.at.13.56.27.mp4 |
Awesome thanks for the thorough response - it may be something I look into in the future to implement on our side with Tutors. |
Solved as part of: #922 Closing this ticket. Please refer any further comments to the ticket linked above. |
Describe what feature you'd like. Pseudo-code, mockups, or screenshots of similar solutions are encouraged!
Can we have the option for the sidebar to push the content instead of overlay the content - this would be useful on Tutors when navigating to see things loading from the table of contents dynamically.
What type of pull request would this be?
New Feature
Any links to similar examples or other references we should review?
https://getuikit.com/docs/offcanvas#animation-modes
The push / reveal options here
The text was updated successfully, but these errors were encountered: