|
Check this out: https://github.com/withastro/starlight/blob/main/packages/starlight/components/Sidebar.astro <div class="md:sl-hidden">
<MobileMenuFooter />
</div>If I was to override MobileMenuFooter, the element that wraps it would remain and in order to override it I would need to override Sidebar component, and as explained in #4123, it's not possible to override some components, and Sidebar is one of them because I wouldn't have access to components inside of it when overriding it. Elements like that that remain, could cause issues. For example, I think it's grid or something like that even when display none is used, it still acts like it's there. not sure. it's annoying too. I just want to keep things clean and less hacky css. Same with: ... in PageFrame. and more... |
Replies: 1 comment 2 replies
|
It’s a tricky balance. The reason in this case is so that users can easily override the footer without also needing to learn how to show/hide the footer. If the ---
import Default from '@astrojs/starlight/components/MobileMenuFooter.astro';
---
<Default />
<div>
Some extra stuff for the mobile footer.
</div>The extra Apologies if the leftover empty div feels a bit clunky but it was a judgment call over whether an empty div or an actually broken behaviour was preferable. |
It’s a tricky balance. The reason in this case is so that users can easily override the footer without also needing to learn how to show/hide the footer. If the
<div class="md:sl-hidden">were inside the footer component, then an override like the following would not behave as users expect:The extra
<div>would appear on desktop devices as well because the CSS controlling visibility would be inside the<Default>component.Apologies if the leftover empty div feels a bit clunky but it was a judgment call over whether an empty div or an act…