From aaf19c92b0210d732c38c7a134616175006af7cc Mon Sep 17 00:00:00 2001 From: Aaron Stephanus Date: Tue, 26 Sep 2023 21:32:23 -0600 Subject: [PATCH 01/17] Ports over redesigned top banner header navigation, and footer Signed-off-by: Aaron Stephanus --- _includes/footer.html | 94 +++-- _includes/header.html | 126 ++++++- _layouts/default.html | 21 -- _sass/_nested-nav.scss | 247 +++++++++++-- _sass/custom/_custom-search.scss | 576 +++++++++++++++++++++++++++++ _sass/custom/custom.scss | 615 ++++++++++++++++++++----------- assets/js/header-nav.js | 6 +- 7 files changed, 1368 insertions(+), 317 deletions(-) create mode 100644 _sass/custom/_custom-search.scss diff --git a/_includes/footer.html b/_includes/footer.html index 16995615df..18f88d504a 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -3,42 +3,78 @@

OpenSearch Links

- - {% for column in site.data.footer.columns %} -
- -

{{ column.title }}

- +
+
+ {% for column in site.data.footer.columns %} +
+

{{ column.title }}

+ +
+ {% endfor %}
- {% endfor %} - +
diff --git a/_includes/header.html b/_includes/header.html index a9e8f3f3c0..971143ac1e 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -17,24 +17,56 @@
- +
-
\ No newline at end of file + + + diff --git a/_layouts/default.html b/_layouts/default.html index 32ff1130c4..0e45755d19 100755 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -127,28 +127,7 @@

Documentation

- {% if site.search_enabled != false or site.use_custom_search == true %} - - {% endif %}
-
diff --git a/_sass/_nested-nav.scss b/_sass/_nested-nav.scss index 792d0e98f8..1cc8dca17f 100644 --- a/_sass/_nested-nav.scss +++ b/_sass/_nested-nav.scss @@ -1,4 +1,139 @@ -@media screen and (min-width: 46.25rem) { +// This is the sum of the logo + the navigation menu items + the search field. +$header-banner-min-width: 1019px; +$header-banner-mobile-breakpoint: 1018px; +$primary-open-sky-t3: #E1F0F9; +$primary-open-sky-s2: #006D97; +$primary-open-sky-s1: #0085B8; +$text: #002a3a; //midnight sky + +@mixin header-level3($color: $primary-open-sky-s1) { + color: $color; + font-family: 'Open Sans'; + font-size: 21px; + font-style: normal; + line-height: 36px; + font-weight: 700; +} +@mixin body-text($color: #000) { + color: $color; + font-family: 'Open Sans'; + font-size: 24px; + font-style: normal; + font-weight: 400; + line-height: 48px; +} +@mixin bottom-border-underline($color: $primary-pacific-blue) { + padding-top: 10px; + padding-bottom: 10px; + border-bottom: 2px solid $color; +} + +@media screen and (max-width: $header-banner-mobile-breakpoint) { + [role="banner"]#top { + > .container { + padding: 0; + } + } + [role="banner"] [role="navigation"] { + margin-top: 0; + li { + margin-right: 0; + margin-left: 0; + margin-top: 0; + margin-bottom: 0; + a { + @include body-text; + color: $primary-open-sky-t3; + } + } + } + + [role="navigation"] .nested-nav { + > li { + padding-bottom: 20px; + padding-top: 15px; + border-bottom-color: $primary-open-sky-s2; + border-bottom-style: solid; + border-bottom-width: 2px; + > .nested-nav--top-menu-item-wrapper { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + flex-wrap: nowrap; + padding: 0; + margin: 0; + border: none; + width: 100%; + &.nested-nav-top-menu-item--wrapper__has_children { + position: relative; + z-index: 10; + } + > .nested-nav--top-menu-item-wrapper--link { + flex-basis: calc(100% - 30px - 20px); + height: 30px; + flex-grow: 1; + flex-shrink: 1; + > a { + @include header-level3($primary-open-sky-t3); + } + } + > .nested-nav--top-menu-item-wrapper--toggle { + flex-basis: 50px; + width: 30px; + height: 30px; + padding: 0 20px 0 0; + flex-shrink: 0; + flex-grow: 0; + .opensearch-toggle-button--wrapper { + display: inline-block; + padding: 0; + margin: 0; + height: 30px; + width: 30px; + > .opensearch-toggle-button-link { + display: none; + padding: 0; + margin: 0; + height: 30px; + width: 30px; + &.opensearch-toggle-button-link__visible { + display: inline-block; + } + } + } + + } + &.nested-nav--top-menu-item--wrapper__without-children { + > .nested-nav--top-menu-item-wrapper--link { + flex-basis: 100%; + width: 100%; + flex-grow: 0; + flex-shrink: 0; + } + > .nested-nav--top-menu-item-wrapper--toggle { + flex-basis: 0; + width: 0; + display: none; + } + } + } + + > ul { + height: 0; + opacity: 0; + transition: all .25s ease-out; + z-index: 1; + position: relative; + &[expanded] { + height: var(--expanded-height); + opacity: 1; + } + } + } + } +} +@media screen and (min-width: $header-banner-min-width) { #top { z-index: 9; } @@ -11,7 +146,7 @@ .nested-nav { li { - font-size: 0.8125rem; + font-size: 13px; } } } @@ -25,11 +160,23 @@ > li { position: relative; float: left; - - > a { - padding: .5em 0; + > .nested-nav--top-menu-item-wrapper { + display: block; + padding: 0; + margin: 0; + border: none; + width: 100%; + height: auto; + > .nested-nav--top-menu-item-wrapper--link { + display: block; + width: 100%; + margin: 0; + height: auto; + } + > .nested-nav--top-menu-item-wrapper--toggle { + display: none; + } } - > ul { list-style: none; position: absolute; @@ -39,7 +186,7 @@ min-width: 100%; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); border-radius: 2px; - left: -.5em; + left: 0; li { margin: 0; @@ -50,22 +197,33 @@ } a { - color: $text; - padding: .46875rem .9375rem; + @include header-level6($primary-open-sky-s3); + width: max-content; display: block; - font-size: 90%; white-space: nowrap; - - &:hover { - color: $attention; + padding: 18px 0 0 0; + margin-left: 18px; + margin-right: 18px; + &:hover, + &.in-category { + color: $primary-open-sky-s2; + text-decoration: underline; + text-decoration-color: $primary-open-sky-s2; + text-decoration-thickness: 2px; + text-underline-offset: 6px; + } + } + &:last-of-type { + a { + padding-bottom: 18px; } } } } - + &:not(:first-child) { > ul { - left: .5em; + left: 0; } } @@ -81,12 +239,13 @@ } ul { - /*display: none;*/ visibility: hidden; display: block; opacity: 0; transition: opacity .25s ease-out, top 0s .5s, visibility 0s .5s; top: calc(100%); + min-width: 100%; + box-sizing: border-box; } a { @@ -98,28 +257,15 @@ /* This is placed in a media query to prevent the momentary distortion of the page * when it is rendered and the browser takes its time to evaluate the @media. */ -@media screen and (max-width: 46.24rem) { +@media screen and (max-width: $header-banner-min-width) { [role="banner"] .nested-nav { li { - line-height: 1.5em; - font-size: 1.125rem; - ul { - margin: 0 0 10px; + margin: 0; } a { - padding: 0; - - &:not(:last-child) { - pointer-events: none; - } - } - } - - > li { - > a.in-category:not(:last-child) { - color: white; + padding: 0 0 0 20px; } } } @@ -127,4 +273,39 @@ [role="banner"] [role="navigation"] .nested-nav li:before { display: none; } -} \ No newline at end of file +} +[role="banner"] [role="navigation"] { + .nested-nav { + > li.landing-page-redesign--nav--search .search > #search-results { + > .custom-search-result { + a { + font-family: "Open Sans Condensed", Impact, "Franklin Gothic Bold", sans-serif; + line-height: 1.6; + font-weight: bold; + background: linear-gradient(rgb(238, 235, 238) 0%, rgb(238, 235, 238) 100%) repeat-x 0 100%/1px 1px; + color: rgb(0, 85, 166); + font-size: 20px; + text-decoration: rgb(0, 85, 166); + > cite { + font-size: 12px; + font-family: "Open Sans", "Segoe UI", Tahoma, sans-serif; + color: #002A3A; + text-decoration: none; + font-style: normal; + display: block; + line-height: 1; + font-weight: normal; + } + } + > span { + font-size: 14px; + color: #1B4859; + line-height: 1.4; + display: block; + overflow-wrap: break-word; + font-weight: normal; + } + } + } + } +} diff --git a/_sass/custom/_custom-search.scss b/_sass/custom/_custom-search.scss new file mode 100644 index 0000000000..d1394610ca --- /dev/null +++ b/_sass/custom/_custom-search.scss @@ -0,0 +1,576 @@ +/*! + * SPDX-License-Identifier: BSD-3-Clause + * + * The OpenSearch Contributors require contributions made to this file be licensed + * under the BSD-3-Clause license or a compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +/*! just-the-docs + * Copyright (c) 2016 Patrick Marsceill + * SPDX-License-Identifier: MIT + */ + + // This is the sum of the logo + the navigation menu items + the search field. + $header-banner-min-width: 1019px; + $header-banner-mobile-breakpoint: 1018px; + + /* + * Notes about some peculiar implementation details regarding the use of !important, + * and media queries with pixels and similar media queries with rems. + * The styles copied over from the project website that uses rems don't work in this + * application, because of disparate roote font sizes. The theme in use provides + * rules using rems, and !important. So, there are some kludges present to get it done. + */ + .copy-banner { + a, + h1 { + white-space: nowrap; + } + } + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; + } + + .search { + position: relative; + z-index: 2; + } + + .search * { + box-sizing: border-box; + } + + @media (min-width: 462.5px) { + .search { + position: relative; + height: 45px !important; + padding-top: 10px; + padding-bottom: 10px; + } + } + + @media (min-width: 46.25rem) { + .search { + position: relative; + height: 45px !important; + padding-top: 10px; + padding-bottom: 10px; + } + } + + .search-input-wrap { + position: relative; + z-index: 1; + transition: height linear 200ms; + } + + @media (min-width: 462.5px) { + .search-input-wrap { + position: absolute; + width: 100%; + height: 45px !important; + box-shadow: none; + transition: width ease 400ms; + } + } + + @media screen and (min-width: 46.25rem) { + .search-input-wrap { + position: absolute; + width: 100% !important; + height: 45px !important; + box-shadow: none; + transition: width ease 400ms; + } + } + + +@media screen and (min-width: $header-banner-min-width) { + .search, + .search-input-wrap { + height: 45px !important; + } +} + +@media screen and (max-width: $header-banner-mobile-breakpoint) { + .search, + .search-input-wrap { + height: 60px !important; + } +} + + .search-input { + position: absolute; + width: 100%; + } + + .search-input:focus { + outline: 0; + } + + .search-input:focus+.search-label .search-icon { + color: #0055A6; + } + + .search-label { + position: absolute; + display: flex; + height: 100%; + padding-left: 16px; + } + + @media (min-width: $header-banner-min-width) { + .search-label { + padding-left: 32px; + transition: padding-left linear 200ms; + } + } + + .search-label .search-icon { + width: 19.2px; + height: 19.2px; + align-self: center; + color: #4D8399; + } + + .search-results { + position: absolute; + left: 0; + display: none; + width: 100%; + max-height: calc(100% - 64px); + overflow-y: auto; + background-color: #fff; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); + } + + @media (min-width: $header-banner-min-width) { + .search-results { + top: 50px; + width: 536px; + max-height: calc(100vh - 200%) !important; + } + } + + .search-results-list { + padding-left: 0; + margin-bottom: 4px; + list-style: none; + font-size: 14px !important; + } + + @media (min-width: 312.5px) { + .search-results-list { + font-size: 16px !important; + } + } + + @media (min-width: $header-banner-min-width) { + .search-results-list { + font-size: 12px !important; + } + } + + @media (min-width: 500px) { + .search-results-list { + font-size: 14px !important; + } + } + + .search-results-list-item { + padding: 0; + margin: 0; + } + + .search-result { + display: block; + padding-top: 4px; + padding-right: 12px; + padding-bottom: 4px; + padding-left: 12px; + } + + .search-result:hover, + .search-result.active { + background-color: #ebedf5; + } + + .search-result-title { + display: block; + padding-top: 8px; + padding-bottom: 8px; + } + + @media (min-width: 312.5px) { + .search-result-title { + display: inline-block; + width: 40%; + padding-right: 8px; + vertical-align: top; + } + } + + .search-result-doc { + display: flex; + align-items: center; + word-wrap: break-word; + } + + .search-result-doc.search-result-doc-parent { + opacity: 0.5; + font-size: 12px !important; + } + + @media (min-width: 312.5px) { + .search-result-doc.search-result-doc-parent { + font-size: 14px !important; + } + } + + @media (min-width: $header-banner-min-width) { + .search-result-doc.search-result-doc-parent { + font-size: 11px !important; + } + } + + @media (min-width: 500px) { + .search-result-doc.search-result-doc-parent { + font-size: 12px !important; + } + } + + .search-result-doc .search-result-icon { + width: 16px; + height: 16px; + margin-right: 8px; + color: #0055A6; + flex-shrink: 0; + } + + .search-result-doc .search-result-doc-title { + overflow: auto; + } + + .search-result-section { + margin-left: 24px; + word-wrap: break-word; + } + + .search-result-rel-url { + display: block; + margin-left: 24px; + overflow: hidden; + color: #959396; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 9px !important; + } + + @media (min-width: 312.5px) { + .search-result-rel-url { + font-size: 10px !important; + } + } + + .search-result-previews { + display: block; + padding-top: 8px; + padding-bottom: 8px; + padding-left: 16px; + margin-left: 8px; + color: #959396; + word-wrap: break-word; + border-left: 1px solid; + border-left-color: #eeebee; + font-size: 11px !important; + } + + @media (min-width: 312.5px) { + .search-result-previews { + font-size: 12px !important; + } + } + + @media (min-width: 312.5px) { + .search-result-previews { + display: inline-block; + width: 60%; + padding-left: 8px; + margin-left: 0; + vertical-align: top; + } + } + + .search-result-preview+.search-result-preview { + margin-top: 4px; + } + + .search-result-highlight { + font-weight: bold; + } + + .search-no-result { + padding-top: 8px; + padding-right: 12px; + padding-bottom: 8px; + padding-left: 12px; + font-size: 12px !important; + } + + @media (min-width: 312.5px) { + .search-no-result { + font-size: 14px !important; + } + } + + .search-button { + position: fixed; + right: 16px; + bottom: 16px; + display: flex; + width: 56px; + height: 56px; + background-color: #fff; + border: 1px solid rgba(0, 85, 166, 0.3); + border-radius: 28px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); + align-items: center; + justify-content: center; + } + + .search-overlay { + position: fixed; + top: 0; + left: 0; + z-index: 1; + width: 0; + height: 0; + background-color: rgba(0, 0, 0, 0.3); + opacity: 0; + transition: opacity ease 400ms, width 0s 400ms, height 0s 400ms; + } + + @media screen and (max-width: 1018px) { + .search-active .search { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + padding: 0; + } + } + + .search-active .search-input-wrap { + height: 64px; + border-radius: 0; + } + + @media (min-width: $header-banner-min-width) { + .search-active .search-input-wrap { + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); + } + } + + .search-active .search-input { + background-color: #fff; + } + + .search-active .search-results { + display: block; + } + + .search-active .search-overlay { + width: 100%; + height: 100%; + opacity: 1; + transition: opacity ease 400ms, width 0s, height 0s; + } + + @media (min-width: $header-banner-min-width) { + .search-active .main { + position: fixed; + right: 0; + left: 0; + } + } + + .search-active .main-header { + padding-top: 64px; + } + + @media (min-width: $header-banner-min-width) { + .search-active .main-header { + padding-top: 0; + } + } + + @media (min-width: $header-banner-min-width) { + .copy-banner .search { + display: block; + height: 48px !important; + margin: 11.5px 0 11.5px 48px; + } + } + + @media (min-width: $header-banner-min-width) { + .copy-banner .search-input-wrap { + height: 48px !important; + right: 0; + } + } + + .search-active .main { + position: relative !important; + } + + @media (min-width: $header-banner-min-width) { + .search-active .search-results { + right: 0; + left: auto; + max-height: calc(100vh - 200% - 60px) !important; + } + } + + #main-header.nav-open~.copy-banner .search { + display: block; + } + + .custom-search-results > div { + padding: 0 16px; + @media screen and (min-width: 1019px) { + padding: 16px; + } + } + + .custom-search-results cite { + font-size: 12px; + font-size: 12px; + font-family: "Open Sans", "Segoe UI", Tahoma, sans-serif; + color: #002A3A; + text-decoration: none; + font-style: normal; + display: block; + line-height: 1; + font-weight: normal; + } + + .search-active { + body { + position: fixed; + + @media (min-width: $header-banner-min-width) { + position: unset; + } + } + } + + .custom-search-results a { + font-size: 20px; + font-size: 20px; + font-family: "Open Sans Condensed", Impact, "Franklin Gothic Bold", sans-serif; + line-height: 1.6; + font-weight: bold; + + background: linear-gradient(rgb(238, 235, 238) 0%, rgb(238, 235, 238) 100%) repeat-x 0 100% / 1px 1px; + color: rgb(0, 85, 166); + font-size: 20px; + text-decoration: rgb(0, 85, 166); + -moz-osx-font-smoothing: grayscale; + + &:hover { + background-image: linear-gradient(rgba(0, 85, 166, 0.45) 0%, rgba(0, 85, 166, 0.45) 100%); + } + } + + .custom-search-results span { + font-size: 14px; + font-size: 14px; + color: #1B4859; + line-height: 1.4; + display: block; + overflow-wrap: break-word; + } + + .custom-search-results span:only-child { + text-align: center; + padding: 16px; + } + + .custom-search-results .highlighted { + background: #EAF4F9; + } + + .custom-search-results { + + a, + h1 { + white-space: unset; + } + } + + .banner-alert~main .custom-search-results { + max-height: calc(100vh - 200% - 60px - 57.6px) !important; + } + + .search-spinner { + display: none; + font-weight: 700; + outline: 0; + user-select: none; + position: absolute; + padding-left: 9.6px; + height: 100%; + } + + .search-spinner.spinning { + display: flex; + } + + .search-spinner.spinning~.search-label { + display: none; + } + + .search-spinner>i { + border-color: rgba(77, 131, 153, 0.2); + position: relative; + animation: spin 0.6s infinite linear; + border-width: 3px; + border-style: solid; + border-radius: 100%; + display: inline-block; + width: 18px; + height: 18px; + vertical-align: middle; + align-self: center; + } + + .search-spinner>i:before { + content: ""; + border: 3px solid rgba(77, 131, 153, 0); + border-top-color: rgba(77, 131, 153, 0.8); + border-radius: 100%; + display: block; + left: -3px; + position: absolute; + top: -3px; + height: 100%; + width: 100%; + box-sizing: content-box; + } + + @keyframes spin { + from { + transform: rotate(0deg) + } + + to { + transform: rotate(359deg) + } + } \ No newline at end of file diff --git a/_sass/custom/custom.scss b/_sass/custom/custom.scss index 2f002720f0..fdec88abea 100755 --- a/_sass/custom/custom.scss +++ b/_sass/custom/custom.scss @@ -36,6 +36,48 @@ } } +@mixin header-level4($color: $primary-open-sky-s3) { + color: $color; + font-family: 'Open Sans'; + font-size: 15px; + font-style: normal; + font-weight: 600; + line-height: 24px; + letter-spacing: 4.5px; + text-transform: uppercase; +} +@mixin header-level5($color: $primary-open-sky-s3) { + color: $color; + font-family: 'Open Sans'; + font-size: 15px; + font-style: normal; + font-weight: 600; + line-height: 24px; +} +@mixin header-level6($color: $primary-open-sky-s2) { + color: $color; + font-family: 'Open Sans'; + font-size: 15px; + font-style: normal; + font-weight: 700; + line-height: 24px; +} + +@mixin bottom-border-underline($color: $primary-pacific-blue) { + padding-top: 10px; + padding-bottom: 10px; + border-bottom: 2px solid $color; +} + +@mixin body-text($color: #000) { + color: $color; + font-family: 'Open Sans'; + font-size: 24px; + font-style: normal; + font-weight: 400; + line-height: 48px; +} + body { @include sans-serif; } @@ -742,7 +784,7 @@ main { @include mq(md) { margin: 0 auto; - max-width: 1400px; + max-width: 1440px; padding: 0 (32/768) * 100%; } @@ -778,10 +820,34 @@ main { -moz-osx-font-smoothing: auto; } +// +// Top banner header navigation menu. +// +$header-banner-min-width: 1019px; +$header-banner-mobile-breakpoint: 1018px; +$header-logo-max-left: 80px; +$header-navigation-max-right: 40px; +$max-container: 1440px; +$light-theme-navigation-background: rgba(0, 163, 224, 0.05); +$primary-pacific-blue-s2: #004381; +$primary-open-sky-s3: #003551; +$primary-pacific-sky-t2: #DCEBF4; +$primary-open-sky-s2: #006D97; +$primary-deep-blue-sea-s3: #001E30; +$primary-open-sky-t3: #E1F0F9; +$primary-deep-blue-sea-t1: #2C5E7A; +$footer-3-column-min: 1440px; +$footer-2-column-max: 1439px; +$footer-2-column-min: 834px; +$footer-1-column-max: 833px; +@mixin gradient-deep-blue-sea { + background: linear-gradient(180deg, #016BA7 0%, #011C2D 97.92%); +} + [role="banner"] { // Includes global navigation, logo, and tagline at top of document @include clearfix; - background: $accent-dark; + background: $light-theme-navigation-background; overflow: hidden; margin: 0; padding: 10px 0 6px; @@ -814,9 +880,8 @@ main { .logo { - @include font-size(40); + font-size: 35px; @include sans-serif; - /*background: url(../img/logo-search.png) 0 0 no-repeat;*/ color: $background-lightest; display: block; float: left; @@ -825,28 +890,28 @@ main { overflow: hidden; text-decoration: none; text-indent: 100%; - width: 170px; height: 36px; position: relative; + + // NOTE: The min() call is wrapped in a calc() call to workaround the + // outdated SASS compiler that has an issue mixing the percentage with pixels. + left: calc(min(80px, 100% - $header-banner-min-width)); + @media screen and (max-width: 1339px) { + left: 0; + } svg { position: absolute; top: 1px; left: 1px } - /*.mdzr-svg & { // deliver svg logo if applicable - background: url(../img/opensearch-logo-monochrome.svg) center center no-repeat; - }*/ - - @include mq(md) { + @include respond-min($header-banner-min-width) { margin-left: 0; } } .menu-button { - @include font-size(20); - background: $accent-dark; - border-radius: 23px; - color: $background-lightest; + font-size: 35px; + color: $primary-deep-blue-sea-t1; cursor: pointer; display: block; float: right; @@ -856,61 +921,88 @@ main { text-align: center; text-decoration: none; width: 45px; - - @include mq(md) { + > i { + position: relative; + top: -1px; + &:nth-of-type(1) { + display: inline-block; + } + &:nth-of-type(2) { + display: none; + } + } + @include respond-min($header-banner-min-width) { display: none; } &:active { color: $attention; } - span { @include visuallyhidden; } &.active { - opacity: 0.5; - - & ~ .nav-menu-on { - max-height: 500px; + > i { + &:nth-of-type(1) { + display: none; + } + &:nth-of-type(2) { + display: inline-block; + } } } } .nav-menu-on { - max-height: 0; + @media screen and (max-width: 1018px) { + height: 0; + } overflow: hidden; -webkit-transition: all 0.3s ease-out; transition: all 0.3s ease-out; - @include mq(md) { + @include respond-min($header-banner-min-width) { // turn off animations if on a desktop width max-height: none; - + height: auto; -webkit-transition: none; transition: none; } + &.active { + // max-height: calc(100vh - 60px); + @include respond-min($header-banner-min-width) { + overflow-y: scroll; + } + + @media screen and (max-width: 1018px) { + height: calc(100vh - 65px); + overflow-y: auto; + > .nested-nav { + @include clearfix; + height: auto; + clear: both; + } + } + } } [role="navigation"] { - background: $accent-dark; + @media screen and (max-width: 1018px) { + background: $primary-open-sky-s3; + } width: 100%; - @include mq(md) { + @include respond-min($header-banner-min-width) { width: auto; float: right; } ul { - margin: 10px 0 0; + margin: 0; padding: 0; - - @include mq(md) { - margin: 0; - } } li { @@ -923,7 +1015,7 @@ main { text-transform: uppercase; margin: 0 10px; - @include mq(md) { + @include respond-min($header-banner-min-width) { margin: 0; border: 0; float: left; @@ -938,22 +1030,18 @@ main { a { color: $background-lightest; display: block; - @include mq(md) { - padding: 20px 0px; - } text-decoration: none; - background: none; + } - &:active, &:hover { - color: $highlight; - } + a:not([class]) { + background-image: unset; } .nav-primary { - @include mq(md) { - position: absolute; - right: 0; - top: 45px; + @include respond-min($header-banner-min-width) { + position: absolute; + right: 0; + top: 45px; } } } @@ -961,26 +1049,137 @@ main { [role="banner"] [role="navigation"] { margin-top: 17px; - + margin-right: 40px; + @media screen and (max-width: 1339px) { + margin-right: 0; + } li { - color: $attention; + color: $primary-open-sky-s3; text-transform: none; - margin-right: 0.5em; - + @media screen and (min-width: 1250px) { + margin-right: 20px; + } + @media screen and (min-width: 1150px) and (max-width: 1249px) { + margin-right: 10px; + } + margin-right: 5px; } li a { display: inline; - color: white; + @include header-level6($primary-open-sky-s3); } - li a.in-category { - color: $attention; + .nested-nav a.in-category, + .nested-nav a:hover { + color: $primary-open-sky-s2; + text-decoration: underline; + text-decoration-color: $primary-open-sky-s2; + text-decoration-thickness: 2px; + text-underline-offset: 6px; } +} - li + li:before { - content: "·"; - color: $text-light; - display: inline-block; - margin-right: 0.25em; +[role=banner] [role=navigation] li.landing-page-redesign--nav--search { + display: inline-flex; + align-items: flex-start; + @media screen and (max-width: $header-banner-mobile-breakpoint) { + display: flex; + width: calc(100% - 40px); + padding: 15px 20px; + height: 60px; + box-sizing: content-box; + } + + >.landing-page-redesign--nav-search--field-with-results { + display: inline-flex; + align-items: flex-start; + min-width: 200px; + justify-content: stretch; + + @media screen and (min-width: $header-banner-min-width) { + position: relative; + top: -20px; + } + + @media screen and (max-width: $header-banner-mobile-breakpoint) { + display: flex; + width: 100%; + position: relative; + z-index: 11; + } + + >.landing-page-redesign--nav-search--field-with-results--field { + flex-basis: 100%; + flex-grow: 1; + flex-shrink: 1; + + >.landing-page-redesign--nav-search--field-with-results--field--wrapper { + position: relative; + + >.search { + >.search-input-wrap { + >.search-input { + padding-left: 9.6px; + padding-right: 6px; + transition: padding-right linear 200ms; + border-radius: 6px; + background-color: $primary-pacific-sky-t2; + @include header-level6($primary-open-sky-s2); + box-sizing: border-box; + + &::placeholder { + @include header-level6($primary-open-sky-s2); + } + + @media screen and (max-width: $header-banner-mobile-breakpoint) { + height: 60px; + padding-top: 0; + padding-bottom: 0; + font-size: 18px; + } + + @media screen and (min-width: $header-banner-min-width) { + height: 45px; + position: relative; + border: none; + } + } + + >.search-spinner { + display: none; + font-weight: 700; + outline: 0; + user-select: none; + position: absolute; + padding-right: 9.6px; + height: 100%; + right: 0; + left: auto; + } + + >.search-label { + right: 4px; + top: 2px; + padding-left: 0; + padding-right: 0; + transition: right linear 200ms; + + @media screen and (max-width: $header-banner-mobile-breakpoint) { + width: 25px; + height: 26px; + } + } + } + } + } + } + } +} + +.search-active [role=banner] [role=navigation] li.landing-page-redesign--nav--search { + >.landing-page-redesign--nav-search--field-with-results { + @media screen and (min-width: $header-banner-min-width) { + top: -10px; + } } } @@ -1004,11 +1203,66 @@ main { .subfooter { @include clearfix; padding: 0 10px; - - @include mq(md) { - padding: 0; + @include gradient-deep-blue-sea; + @include respond-min(46.25rem) { + padding: 0; + } + .subfooter--flex-wrapper { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: flex-start; + .subfooter--columns-wrapper { + flex-basis: 1265px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + align-items: flex-start; + > .subfooter--columns-wrapper--column { + @media screen and (min-width: $footer-3-column-min) { + flex-basis: 33%; + max-width: 350px; + } + @media screen and (max-width: $footer-2-column-max) and (min-width: $footer-2-column-min) { + &:nth-of-type(1) { + flex-basis: calc(50% - 80px); + padding-left: 80px; + } + &:nth-of-type(2) { + flex-basis: calc(50% - 40px); + padding-left: 40px; + } + &:nth-of-type(3) { + flex-basis: calc(100% - 80px); + padding-left: 80px; + } + } + @media screen and (max-width: $footer-1-column-max) { + flex-basis: calc(100% - 80px); + padding-left: 40px; + padding-bottom: 80px; + } + > h4 { + @include header-level4($white); + } + > ul { + list-style-type: none; + margin: 0; + padding: 0; + > li { + @media screen and (max-width: $footer-1-column-max) { + @include body-text($white); + } + @media screen and (min-width: $footer-2-column-min) { + @include header-level5($white); + } + } + } + } + } } - .col { &:first-child { h2 { @@ -1040,11 +1294,9 @@ main { border-top: 1px solid $line; color: $background-lightest; font-weight: 700; - margin: 20px 0 .83em 0; + margin-top: 20px; padding: 30px 0 10px; - line-height: 1.6; - - @include mq(md) { + @include respond-min(46.25rem) { border: none; margin-top: 0; } @@ -1077,34 +1329,77 @@ main { } .footer { - background: $accent-dark; - margin-top: 20px; + background: $primary-deep-blue-sea-s3; padding: 10px 0 30px; color: $white; - a { - color: $accent-light; - background: none; - text-decoration: underline; - - &:hover, - &:active, - &:focus { - text-decoration: underline; - background: none; + .footer--flex-wrapper { + text-align: center; + .footer--legal-rows-wrapper { + text-align: left; + margin: auto; + max-width: 1265px; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: space-between; + align-items: flex-start; + row-gap: 40px; + @media screen and (max-width: $footer-2-column-max) { + padding-left: 80px; + } + @media screen and (max-width: $footer-1-column-max) { + padding-left: 40px; + } + > .footer--legal-rows-wrapper--row { + flex-basis: 60px; + @media screen and (max-width: $footer-1-column-max) { + > .footer--legal-rows-wrapper--row--logo__desktop { + display: none; + } + > .footer--legal-rows-wrapper--row--logo__mobile { + display: block; + > div { + height: 50px; + color: #FFF; + font-family: 'Open Sans'; + font-size: 24.666px; + font-style: normal; + font-weight: 600; + line-height: 36.177px; + letter-spacing: 8.387px; + text-transform: uppercase; + > a { + color: #fff; + } + } + } + } + @media screen and (min-width: $footer-2-column-min) { + > .footer--legal-rows-wrapper--row--logo__mobile { + display: none; + } + > .footer--legal-rows-wrapper--row--logo__desktop { + display: block; + } + } + } } } - svg { - float: left; - height: 50px; - padding-top: 40px; - padding-right: 30px; + a, svg { color: $accent-light; } + svg { + float: left; + height: 50px; + padding-top: 40px; + padding-right: 30px; + + } .copyright { float: left; @include font-size(12); margin: 20px 0 0 10px; - @include mq(md) { + @include respond-min(46.25rem) { max-width: 80%; padding-top: 30px; margin: 0; @@ -1290,46 +1585,29 @@ main { flex-flow: row nowrap; align-items: center; } - - .search { - display: none; - - @include mq(md) { - display: block; - height: 3rem !important; - margin-left: 3rem; - } - } - - @include mq(md) { - .search-input-wrap { - height: 3rem !important; - right: 0; - } - } } -.search-active { - body { - position: fixed; +// .search-active { +// body { +// position: fixed; - @include mq(md) { - position: unset; - } - } - .main { - position: relative !important; - } +// @include mq(md) { +// position: unset; +// } +// } +// .main { +// position: relative !important; +// } - .search-results { - @include mq(md) { - right: 0; - left: auto; +// .search-results { +// @include mq(md) { +// right: 0; +// left: auto; - max-height: calc(100vh - 200% - 60px) !important; - } - } -} +// max-height: calc(100vh - 200% - 60px) !important; +// } +// } +// } .site-header { @@ -1437,108 +1715,5 @@ version-selector { --link-color: #{$blue-300}; } -.custom-search-results { - & > div { - padding: 1rem; - } - - cite { - @include font-size(12); - @include sans-serif; - color: $grey-dk-300; - text-decoration: none; - font-style: normal; - display: block; - line-height: 1; - font-weight: normal; - } - - a { - @include font-size(20); - @include heading-sans-serif; - line-height: 1.6; - font-weight: bold; - outline: none; - } - - span { - @include font-size(14); - color: $grey-dk-200; - line-height: 1.4; - display: block; - overflow-wrap: break-word; - - &:only-child { - text-align: center; - padding: 1rem; - } - } - - .highlighted { - background: #EAF4F9; - } -} - -@include respond-min(46.25rem) { - .banner-alert ~ main .custom-search-results { - max-height: calc(100vh - 200% - 60px - 3.6rem) !important; - } -} - -.search-spinner { - display: none; - font-weight: 700; - outline: 0; - user-select: none; - - position: absolute; - padding-left: 0.6rem; - height: 100%; - - &.spinning { - display: flex; - - & ~ .search-label { - display: none; - } - } -} - -.search-spinner > i { - border-color: rgba($grey-dk-000, 0.2); - position: relative; - animation: spin 0.6s infinite linear; - border-width: 3px; - border-style: solid; - border-radius: 100%; - display: inline-block; - width: 18px; - height: 18px; - vertical-align: middle; - align-self: center; - - &:before { - content: ""; - border: 3px solid rgba($grey-dk-000, 0); - border-top-color: rgba($grey-dk-000, 0.8); - border-radius: 100%; - display: block; - left: -3px; - position: absolute; - top: -3px; - height: 100%; - width: 100%; - box-sizing: content-box; - } -} - -@keyframes spin { - from { - transform: rotate(0deg) - } - to { - transform: rotate(359deg) - } -} - +@import "./_custom-search.scss"; @import "../_nested-nav.scss"; diff --git a/assets/js/header-nav.js b/assets/js/header-nav.js index f44eba602a..7fddd39351 100644 --- a/assets/js/header-nav.js +++ b/assets/js/header-nav.js @@ -1,3 +1,5 @@ document.querySelector('.menu-button')?.addEventListener('click', el => { - el.currentTarget.classList.toggle('active'); -}); \ No newline at end of file + const siteNavigation = document.querySelector('div[role="navigation"].nav-menu-on'); + siteNavigation?.classList?.toggle?.('active'); + el.currentTarget.classList?.toggle?.('active'); +}); From 6b242d0c54b6926c95a59d9bd325b721e6787925 Mon Sep 17 00:00:00 2001 From: Aaron Stephanus Date: Wed, 27 Sep 2023 12:43:13 -0600 Subject: [PATCH 02/17] Adds style overrides for search functionality Signed-off-by: Aaron Stephanus --- _includes/header.html | 2 +- _sass/custom/_custom-search.scss | 27 +++++++++++++++++---------- _sass/custom/custom.scss | 13 +++++++++++-- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/_includes/header.html b/_includes/header.html index 971143ac1e..8080e4a340 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -91,7 +91,7 @@
-