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

Fix/3967 fix menu issues #4

Merged
Merged
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
27 changes: 27 additions & 0 deletions app/assets/stylesheets/darkswarm/menu.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ nav.top-bar {
height: $topbar-height;
}

@media #{$large-only} {
.top-bar__menu-item-with-icon span {
display: none;
}

.top-bar__current-hub-prefix {
display: none;
}

.top-bar__current-hub-name {
display: inline-block;
max-width: 10em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

.top-bar-section ul li > a.top-bar__menu-item-with-icon {
display: inline;
}

.top-bar__menu-item-with-icon i,
.top-bar__menu-item-with-icon img {
line-height: $topbar-height;
}

.top-bar-section {
a.icon {
&:hover {
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/darkswarm/variables.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $brand-colour: #f27052;
// Topbar
$topbar-height: rem-calc(64);
$topbar-link-padding: $topbar-height / 3;
$topbar-arrows: false;

$topbar-bg: $white;
$topbar-bg-color: $topbar-bg;
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/menu/_language_selector.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%li.language-switcher.has-dropdown
%a{href: '#'}
%a{href: '#', class: "top-bar__menu-item-with-icon"}
%i.ofn-i_071-globe
%span= t 'language_name'
%ul.dropdown
- OpenFoodNetwork::I18nConfig.selectable_locales.each do |l|
%li
%a{href: "?locale=#{l.to_s}" }= t('language_name', locale: l)
%a{href: "?locale=#{l.to_s}" }= t('language_name', locale: l)
7 changes: 4 additions & 3 deletions app/views/shared/menu/_large_menu.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@

%li.current_hub{"ng-controller" => "CurrentHubCtrl", "ng-show" => "CurrentHub.hub.id", "ng-cloak" => true}
%a{href: main_app.shop_path}
= t 'label_shopping'
= '@'
%span {{ CurrentHub.hub.name | truncate:25 }}
%span{ class: "top-bar__current-hub-prefix" }
= t 'label_shopping'
= '@'
%span{ class: "top-bar__current-hub-name" } {{ CurrentHub.hub.name | truncate:25 }}
%li.cart{"ng-cloak" => true}
= render partial: "shared/menu/cart"
2 changes: 1 addition & 1 deletion app/views/shared/menu/_signed_in.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

%li.user-menu.has-dropdown.not-click

%a{href: "#"}
%a{href: "#", class: "top-bar__menu-item-with-icon"}
%img{ src: "/assets/menu/icn-profile.svg" }
%span
= t '.profile'
Expand Down