Skip to content

Commit 01790f0

Browse files
authored
Fix theme dropdown menu going offscreen (#2387)
This pull request fixes the position of the theme dropdown menu. Previously, when the theme dropdown was located on the far right side of the page, the dropdown menu went offscreen. This change aligns the right edge of the dropdown menu with the dropdown button. - Closes #2384
1 parent d17eb2e commit 01790f0

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/theme-switcher.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="{{ _('Dark') }}"></i>
77
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="{{ _('System Settings') }}"></i>
88
</button>
9-
<ul class="dropdown-menu">
9+
<ul class="dropdown-menu dropdown-menu-end">
1010
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>{{ _('System Settings') }}</button></li>
1111
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>{{ _('Light') }}</button></li>
1212
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>{{ _('Dark') }}</button></li>

‎tests/test_build/navbar_theme.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings">
88
</i>
99
</button>
10-
<ul class="dropdown-menu">
10+
<ul class="dropdown-menu dropdown-menu-end">
1111
<li>
1212
<button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto">
1313
<i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1">

‎tests/test_build/sidebar_subpage.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings">
4343
</i>
4444
</button>
45-
<ul class="dropdown-menu">
45+
<ul class="dropdown-menu dropdown-menu-end">
4646
<li>
4747
<button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto">
4848
<i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1">

0 commit comments

Comments
 (0)