Skip to content
Discussion options

You must be logged in to vote

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:

---
import Default from '@astrojs/starlight/components/MobileMenuFooter.astro';
---

<Default />
<div>
  Some extra stuff for the mobile footer.
</div>

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…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@babakfp
Comment options

@delucis
Comment options

Answer selected by babakfp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants