Skip to content
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

Improve visual styling of mobile menu toggle when menu is open #2727

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/small-days-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Improve visual styling of mobile menu toggle when menu is open
16 changes: 8 additions & 8 deletions packages/starlight/components/MobileMenuToggle.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import Icon from '../user-components/Icon.astro';
aria-controls="starlight__sidebar"
class="sl-flex md:sl-hidden"
>
<Icon name="bars" />
<Icon name="bars" class="open-menu" />
<Icon name="close" class="close-menu" />
</button>
</starlight-menu-button>

Expand Down Expand Up @@ -67,19 +68,18 @@ import Icon from '../user-components/Icon.astro';
cursor: pointer;
}

[aria-expanded='true'] button {
background-color: var(--sl-color-gray-2);
box-shadow: none;
[aria-expanded='true'] button .open-menu {
display: none;
}

:not([aria-expanded='true']) button .close-menu {
display: none;
}

:global([data-theme='light']) button {
background-color: var(--sl-color-black);
color: var(--sl-color-white);
}

:global([data-theme='light']) [aria-expanded='true'] button {
background-color: var(--sl-color-gray-5);
}
</style>

<style is:global>
Expand Down
Loading