Skip to content
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
113 changes: 99 additions & 14 deletions app/assets/stylesheets/responsive/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -560,29 +560,39 @@ p.locale-list-trigger {
display: none;
}

.rsp_menu_button{
.rsp_menu_button {
position: absolute;
top: 5px; // vertically centre the button in the header
right: 4px; // 15px for margin minus 9 for background offset
@extend .image-replacement;
background-image: image-url('hamburger.png');
background-repeat: no-repeat;
background-position: center 10px;
background-size: 28px 26px;
top: 50%;
right: 8px;
transform: translateY(-50%);
width: 44px;
height: 38px;
height: 44px;
padding: 0;
/* Make sure clickable area covers image */
background-image: none;
text-indent: 0;
overflow: visible;

a {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
color: $brand_primary;
text-decoration: none;
&:focus,
&:focus-visible {
outline: 2px solid $brand_primary;
outline-offset: 2px;
}
}
}

&:target {
.rsp_menu_button {
top: 5px;
right: 4px;
top: 8px;
right: 8px;
transform: none;
}
}
}
Expand Down Expand Up @@ -1325,6 +1335,81 @@ a.button-tertiary {
}
}

// Hamburger icon (CSS bars — no webfont, no raster sprite)
.rsp_menu_button__bars {
display: block;
position: relative;
width: 22px;
height: 2px;
background-color: $brand_primary;
box-shadow: 0 7px 0 $brand_primary, 0 -7px 0 $brand_primary;
}

.rsp_menu_button__bars--close {
box-shadow: none;
transform: rotate(45deg);
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
width: 22px;
height: 2px;
background-color: $brand_primary;
transform: rotate(90deg);
}
}

@media (max-width: $main_menu-mobile_menu_cutoff) {
#banner_content.banner_content {
position: relative;
padding: 12px 56px 12px 16px;
}

#banner:target {
#navigation_search.navigation_search,
#user_locale_switcher.locale-list {
display: block;
float: none;
width: auto;
padding: 12px 16px 0;
}

#topnav.topnav {
display: block;
padding: 8px 16px 16px;
}

.navigation {
display: block;
width: auto;
max-width: none;
margin: 0;
> li {
display: block;
float: none;
}
}

.topnav__auth {
display: block;
margin-top: 16px;
#logged_in_bar.logged_in_bar {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 8px;
width: 100%;
}
.create-account-link,
.sign_in_link {
width: 100%;
text-align: center;
}
}
}
}

// ---- 3.1 Hero (title / subtitle boxes + CTAs over image) -------------------
.homepage-hero {
padding: 4em 0 5em;
Expand Down
8 changes: 6 additions & 2 deletions lib/views/general/_responsive_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
</div>

<div class="rsp_menu_button">
<a href="#banner" class="open"> <i class="icon-menu"></i> Menu </a>
<a href="#" class="close"> <i class="icon-menu"></i> Close </a>
<a href="#banner" class="open" aria-label="<%= _('Open menu') %>">
<span class="rsp_menu_button__bars" aria-hidden="true"></span>
</a>
<a href="#" class="close" aria-label="<%= _('Close menu') %>">
<span class="rsp_menu_button__bars rsp_menu_button__bars--close" aria-hidden="true"></span>
</a>
</div>

<div id="navigation_search" class="navigation_search">
Expand Down
9 changes: 9 additions & 0 deletions locale-theme/en/app.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
#
# msgid "Make and browse Freedom of Information (FOI) requests"
# msgstr "Make and browse Right to Know (RTI) requests"

msgid "Open menu"
msgstr "Open menu"

msgid "Close menu"
msgstr "Close menu"

msgid "Create account"
msgstr "Create account"
9 changes: 9 additions & 0 deletions locale-theme/sv/app.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@

msgid "Services"
msgstr "Tjänster"

msgid "Open menu"
msgstr "Öppna menyn"

msgid "Close menu"
msgstr "Stäng menyn"

msgid "Create account"
msgstr "Skapa konto"