From a4eff3aa190dc374dfcaab023a4bad1b330e5e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 7 Jul 2021 23:08:32 +0200 Subject: [PATCH] Simplify subnavigation layout Using `flex` instead of a fixed width for the navigation, the elements take all the available space when the search form isn't present. That wasn't the case before and produced a strange effect on medium-sized screens. This way we also align the search to the right. --- app/assets/stylesheets/layout.scss | 20 +++++++++++--------- app/views/layouts/_header.html.erb | 19 +++++++------------ app/views/shared/_subnavigation.html.erb | 2 +- spec/system/budgets/investments_spec.rb | 2 +- spec/system/debates_spec.rb | 6 +++--- spec/system/proposals_spec.rb | 8 ++++---- 6 files changed, 27 insertions(+), 30 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 74cbddf3c..4cdc650f5 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -692,21 +692,18 @@ body > header, .subnavigation { @include full-width-background; - - @include breakpoint(small only) { - @include grid-row-nest; - } + @include grid-column-gutter; + display: flex; + flex-direction: column; @include breakpoint(medium) { background: $body-background; color: $text; + flex-direction: row; padding-bottom: 0; - } - .search-form-header { - - @include breakpoint(small only) { - padding-left: rem-calc(map-get($grid-column-gutter, small) / 2); + > :first-child { + flex-grow: 1; } } @@ -790,6 +787,11 @@ body > header, } } +.subnavigation-with-top-links { + padding-left: 0; + padding-right: 0; +} + .top-bar-right { .is-active { diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index b95335e96..1e101fa36 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -33,25 +33,20 @@
-
-