Drawer with Popover Implementation #4512
Replies: 5 comments
|
Some tweaks (I hope improvements), still need work: https://play.tailwindcss.com/LcW94gtLBQ |
|
Thanks for the example 🙏 There was a conversation about this on Discord. I quote my answer here too:
I hope we can find a way. |
|
Adding a summary of the rest of our Discord conversation for documentation: Some of the ideas I proposed to get around issue 2:
I don't think there will ever be CSS that can open and close popovers. It sounds like the only alternative is to use a small amount of JavaScript - in my scenario that would be an acceptable solution / tradeoff / progressive enhancement, as resizing the screen while the sidebar is open and JavaScript is disabled is an uncommon situation, and the issue is minor / visual (fixed with a click or tap). It would be nice to have this as another option and just document the suggested JS to go with it. |
|
Thanks for the suggestions @jsulgrove 💚 To be honest, I don't see a benefit here 😅 We already have a native CSS/HTML solution:
And we introduce a new method that is broken by default and needs a piece of JS (for each framework syntax) to work? As I stated before, I'm positive about using new APIs, we already used popover for daisyUI |
|
Fair enough. Thank you for outlining your reasoning, I really appreciate it. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
As I have been writing a component based frontend for my website, I have found the current drawer sidebar structure frustrating. Specifically, I don't like the idea of having to wrap the entire page in a sidebar component when really a sidebar should consist of just a sidebar. So I spent some time working on a version that utilizes a popover. At the bare minimum, you need to apply the
drawer-sideclass to your sidebar element and wire up the popover so you can toggle it open and closed.Benefits:
drawer-open, the flex layout is now automatically applied to the parent of the element with thedrawer-openclass.Cons:
drawer-openlayouts, the implementation must explicitly override the popover's top layer behavior to reintegrate the element into the standard document flow.It's not perfect but I'd love your thoughts
https://play.tailwindcss.com/TVqPeCLCUz
All reactions