From 0fbd67c3e4b9a6587f95bcdc36cc7875429f0893 Mon Sep 17 00:00:00 2001 From: Nick Budak Date: Thu, 12 Aug 2021 16:38:52 -0400 Subject: [PATCH] Adjust site search appearance on search page per @gissoo --- cdhweb/pages/templates/cdhpages/search.html | 11 +++- sitemedia/scss/base/_forms.scss | 70 +++++++++++++-------- sitemedia/scss/base/_navigation.scss | 10 ++- sitemedia/scss/site.scss | 5 ++ 4 files changed, 63 insertions(+), 33 deletions(-) diff --git a/cdhweb/pages/templates/cdhpages/search.html b/cdhweb/pages/templates/cdhpages/search.html index ab35b28fa..06366dc35 100644 --- a/cdhweb/pages/templates/cdhpages/search.html +++ b/cdhweb/pages/templates/cdhpages/search.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load humanize cdh_tags wagtailcore_tags %} +{% load static humanize cdh_tags wagtailcore_tags %} {# Site search page #} {% block bodyclass %}search{% endblock bodyclass %} @@ -7,9 +7,14 @@ {% block main %}

{{ page_title }}

{% if page_obj %} diff --git a/sitemedia/scss/base/_forms.scss b/sitemedia/scss/base/_forms.scss index 8a240c894..8120bd674 100644 --- a/sitemedia/scss/base/_forms.scss +++ b/sitemedia/scss/base/_forms.scss @@ -96,42 +96,58 @@ select { // search page form form.search { - position: relative; + position: absolute; + top: 0; + left: 0; + width: 100vw; + z-index: 1; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2), 0px 1px 18px rgba(0, 0, 0, 0.12); + background: $base-background-color; + height: $small-header-nav-height; + + @media (min-width: $medium-min-width) { + height: $header-nav-height; + } + + a.home-page, + label.submit { + flex: none; + display: flex; + justify-content: center; + align-items: center; + height: 100%; + padding: 14px; + + img { + height: 100%; + } + } + + label.submit { + margin: 0; + cursor: pointer; + } input[type="search"] { + flex: auto; + height: 100%; font-size: 16px; - line-height: 20px; border: none; - box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2), 0px 1px 18px rgba(0, 0, 0, 0.12); - padding: 16px; + padding: 0 16px; + margin: 0; + max-width: $small-content-width; + box-shadow: none; - @media (min-width: $large-min-width) { + @media (min-width: $medium-min-width) { + max-width: $medium-content-width; font-size: 20px; - line-height: 24px; - padding: 16px 16px 16px 100px; } - } - - input[type="submit"] { - @include cdh-icon("search"); - background-color: transparent; - font-size: 0; - background-repeat: no-repeat; - background-position: center; - background-size: contain; - content: ""; - position: absolute; - top: 0; - right: 0; - width: 24px; - height: 24px; - top: 14px; - right: 16px; @media (min-width: $large-min-width) { - width: 30px; - height: 30px; - right: 116px; + max-width: $large-content-width; } } } diff --git a/sitemedia/scss/base/_navigation.scss b/sitemedia/scss/base/_navigation.scss index 1e5f34991..82e1fea11 100644 --- a/sitemedia/scss/base/_navigation.scss +++ b/sitemedia/scss/base/_navigation.scss @@ -46,12 +46,16 @@ header.nav { } - // hide via pitbar or permanently when on search page - &.hidden, - body.search & { + // hide via pitbar + &.hidden { margin-top: -90px; } + // hide and remove from a11y tree on search page + body.search & { + display: none; + } + a { color: #000000; text-decoration: none; diff --git a/sitemedia/scss/site.scss b/sitemedia/scss/site.scss index c301f8757..b160fb7c9 100644 --- a/sitemedia/scss/site.scss +++ b/sitemedia/scss/site.scss @@ -1780,4 +1780,9 @@ body.richtextpage { #ed11y-panel { bottom: 6.5em !important; right: 3em !important; /* line up with wagtail user bar */ +} + +/* search page */ +body.search { + padding: 0; } \ No newline at end of file