Fix menu on "wide" small screens

The menu didn't look properly on these screens since commit dcec003d0.

On small screens with enough horizontal space to show the menu button,
the logo, and the contents of the menu, all three elements were shown on
the same row, which looked broken.

Now the contents of the menu are shown below the menu button.

Note that, to force this, we're making the contents of the menu 100%
wide. That means links would take the 100% of the space, which would
make it easy to click on a link while trying to scroll when using
touchscreens. So we're making the links as wide as their text, which
also has a disadvantage: it's harder to click on narrow links like
"SDG".
This commit is contained in:
Javi Martín
2023-01-28 02:10:32 +01:00
parent 86dd34d32e
commit 045ac648d7
3 changed files with 9 additions and 3 deletions

View File

@@ -574,6 +574,14 @@ body > header,
@include breakpoint(small only) { @include breakpoint(small only) {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
.responsive-menu {
width: 100%;
a {
display: inline-block;
}
}
} }
@include breakpoint(medium) { @include breakpoint(medium) {

View File

@@ -31,12 +31,10 @@
padding-top: $line-height / 2; padding-top: $line-height / 2;
position: relative; position: relative;
text-align: left; text-align: left;
width: 100%;
@include breakpoint(medium) { @include breakpoint(medium) {
display: block; display: block;
font-weight: bold; font-weight: bold;
width: auto;
&:hover { &:hover {
@include anchor-color; @include anchor-color;

View File

@@ -24,7 +24,7 @@
<% end %> <% end %>
</h1> </h1>
<div id="responsive-menu"> <div id="responsive-menu" class="responsive-menu">
<%= render Layout::AccountMenuComponent.new(current_user) %> <%= render Layout::AccountMenuComponent.new(current_user) %>
<div class="show-for-small-only"> <div class="show-for-small-only">