diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ebdd80c5..4b83ba75 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,44 +1,33 @@ @import "bootstrap"; -$site-header: 65px; +$site-header: 56px; $site-footer: 65px; +$zindex-header: 1080; // This ensures the header will be above popovers/tooltips. .container { min-height: calc(100vh - #{$site-footer} - #{$site-header}); -} - -.site-header { - height: $site-header; - padding: 20px 25px; - background-color: #f2f2f2; - border-bottom: 1px solid #ddd; - ul { - display: flex; - justify-content: space-between; - text-align: center; - margin: auto; - } + &.search-page { + max-width: 100vw; - li { - display: inline-block; - text-align: center; - margin: 0 20px; - - &.active { - font-weight: 600; - } - - a { - text-decoration: none; - - &:hover { - text-decoration: underline; + @include media-breakpoint-up(lg) { + .no-wrap-row { + display: flex; + flex-flow: row; + flex-wrap: nowrap; } } } } +@include media-breakpoint-up(lg) { + .navbar.sticky-header { + position: sticky; + top: 0; + z-index: $zindex-header; + } +} + .site-footer { min-height: $site-footer; height: auto; @@ -100,6 +89,10 @@ $site-footer: 65px; overflow: hidden; } +.card-body-scroll { + overflow: scroll; +} + @include media-breakpoint-up(lg) { .sticky-column { position: sticky; @@ -180,3 +173,24 @@ td.browser-support-info { margin-top: 8px; } } + +@include media-breakpoint-up(lg) { + .search-sidebar { + height: calc(100vh - #{$site-header}); + position: sticky; + top: $site-header; + border-right: 1px solid #ddd; + overflow: scroll; + + .form-group-title { + text-transform: uppercase; + font-size: 0.8rem; + font-weight: 600; + } + + .search-button-container { + position: sticky; + bottom: 10px; + } + } +} diff --git a/app/controllers/features_controller.rb b/app/controllers/features_controller.rb index eeb0e661..f91331f5 100644 --- a/app/controllers/features_controller.rb +++ b/app/controllers/features_controller.rb @@ -1,5 +1,7 @@ class FeaturesController < ApplicationController def index + @sticky_header = true + if params[:query].present? features = Feature.search(params[:query]) else diff --git a/app/views/features/_features_list.html.erb b/app/views/features/_features_list.html.erb index 2bbb2461..fadcc620 100644 --- a/app/views/features/_features_list.html.erb +++ b/app/views/features/_features_list.html.erb @@ -31,7 +31,7 @@ <%= link_to "MDN", feature.mdn_url, class: "card-link mdn-link" %> <% end %> -