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

Add search button to header #3483

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b021a18
add initial changes
precious-onyenaucheya-ons Jan 29, 2025
7bf2beb
update styling and approve visual test
precious-onyenaucheya-ons Jan 30, 2025
4d81fc4
limit popular searches
precious-onyenaucheya-ons Jan 30, 2025
b0eb10b
rename class
precious-onyenaucheya-ons Jan 30, 2025
586e897
remove redundant styling
precious-onyenaucheya-ons Jan 30, 2025
672fa08
Merge branch 'main' into feature/162-header-search-button
precious-onyenaucheya-ons Feb 6, 2025
6b43a75
update styling
precious-onyenaucheya-ons Feb 6, 2025
b375a29
update onslogo size
precious-onyenaucheya-ons Feb 7, 2025
7fb0698
more styling update
precious-onyenaucheya-ons Feb 10, 2025
289b12b
Merge branch 'main' into feature/162-header-search-button
precious-onyenaucheya-ons Feb 12, 2025
700de62
update the search button
precious-onyenaucheya-ons Feb 12, 2025
f6c0fef
fix tests
precious-onyenaucheya-ons Feb 17, 2025
5378d07
approve visual tests
precious-onyenaucheya-ons Feb 17, 2025
4cc084c
fix toggle
precious-onyenaucheya-ons Feb 18, 2025
b1bf012
Merge branch 'main' into feature/162-header-search-button
precious-onyenaucheya-ons Feb 21, 2025
b3b5c22
revert changes to the ons icon
precious-onyenaucheya-ons Feb 21, 2025
82fc26d
update styling and visual tests
precious-onyenaucheya-ons Feb 21, 2025
8335a2e
address PR comments
precious-onyenaucheya-ons Feb 21, 2025
0a4cfe4
Merge branch 'main' into feature/162-header-search-button
precious-onyenaucheya-ons Feb 24, 2025
446da04
address pr comments
precious-onyenaucheya-ons Feb 26, 2025
3df9796
update focus state
precious-onyenaucheya-ons Feb 27, 2025
f56ccec
remove unecessary style
precious-onyenaucheya-ons Mar 4, 2025
6cd046d
Fix issue with breakpoints
precious-onyenaucheya-ons Mar 4, 2025
69c7998
remove important key word in css
precious-onyenaucheya-ons Mar 5, 2025
7b2e368
update close icon svg and fix focus states
precious-onyenaucheya-ons Mar 6, 2025
26eb83c
remove extra space in macro file
precious-onyenaucheya-ons Mar 6, 2025
a4bd79b
address comments on the search
precious-onyenaucheya-ons Mar 7, 2025
809dbdc
fix more issues with the menu and search
precious-onyenaucheya-ons Mar 7, 2025
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
20 changes: 20 additions & 0 deletions __snapshots__/layout/_template.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,14 @@ exports[`base page template matches the favicons block override snapshot 1`] = `

</div>



</div>
</div>





</div>

Expand Down Expand Up @@ -473,10 +477,14 @@ exports[`base page template matches the footer block override snapshot 1`] = `

</div>



</div>
</div>





</div>

Expand Down Expand Up @@ -848,6 +856,7 @@ exports[`base page template matches the full configuration snapshot 1`] = `

</div>



</div>
</div>
Expand Down Expand Up @@ -890,6 +899,9 @@ exports[`base page template matches the full configuration snapshot 1`] = `

</nav>





</div>

Expand Down Expand Up @@ -2005,10 +2017,14 @@ exports[`base page template matches the meta block override snapshot 1`] = `

</div>



</div>
</div>





</div>

Expand Down Expand Up @@ -2232,10 +2248,14 @@ exports[`base page template matches the social block override snapshot 1`] = `

</div>



</div>
</div>





</div>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 157 additions & 2 deletions src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,51 @@ $button-shadow-size: 3px;
}
}

&--header-search &,
&--header-search:focus &,
&--header-search:active &,
&--header-search.active &,
&--header-search:active:focus &,
&--header-search.active:focus & {
&__inner {
background: var(--ons-color-ocean-blue) !important;
}
}

&--header-search &,
&--header-search:active &,
&--header-search.active & {
&__inner {
padding: 0.75rem 1rem !important;
border: 2px solid var(--ons-color-ocean-blue);
border-radius: 0;
box-shadow: none;
.ons-icon {
fill: var(--ons-color-text-inverse) !important;
height: 28px;
width: 28px;
}
}
}

&--header-search:hover & {
&__inner {
background: var(--ons-color-night-blue) !important;
}
}

&--header-search:focus & {
&__inner {
box-shadow:
0 0 0 1px var(--ons-color-black),
0 0 0 4px var(--ons-color-focus) !important;
outline: 3px solid rgb(0 0 0 / 0%);
outline-offset: 1px;
z-index: 4;
border: 2px solid var(--ons-color-black);
}
}

&__inner {
background: var(--ons-color-button);
border-radius: $input-radius;
Expand Down Expand Up @@ -556,7 +601,7 @@ $button-shadow-size: 3px;
&--menu {
align-items: center;
display: flex;
padding: 1.5rem;
padding: 1rem;
border-bottom: 4px solid rgb(0 0 0 / 0%);
.ons-icon {
transform: rotate(90deg);
Expand All @@ -575,11 +620,14 @@ $button-shadow-size: 3px;
margin-top: 0;
width: 1rem;
}
.ons-btn__text {
height: 24px;
}
}
}

&--menu:focus {
background-color: var(--ons-color-focus);
background-color: var(--ons-color-focus) !important;
border-color: var(--ons-color-black);
}

Expand Down Expand Up @@ -629,6 +677,113 @@ $button-shadow-size: 3px;
}
}
}

&--search-icon,
&--close {
border-bottom: 4px solid transparent;
align-items: center;
display: flex;
padding: 1rem;
}

&--search-icon &,
&--close & {
&__inner {
background: rgb(0 0 0 / 0%);
box-shadow: none;
padding: 0;
.ons-icon {
@extend .ons-u-m-no;

fill: var(--ons-color-text-link);
height: 1.5rem;
width: 1.5rem;
}
}
}

&--search-icon:hover {
border-bottom: 4px solid rgb(0 0 0 / 0%);
border-color: var(--ons-color-text-link-hover);
}

&--search-icon:focus:hover:not(:active, .active) {
.ons-btn__inner {
background: none;
box-shadow: none;
}
}

&--close:focus:hover:not(:active, .active) {
.ons-btn__inner {
background: none;
box-shadow: none;
}
}

&--close:active,
&--close[aria-expanded='true'] {
@extend .ons-u-ml-no;

border-color: var(--ons-color-text-link-hover);
background-color: var(--ons-color-branded-tint);
}

&--search-icon:hover &,
&--search-icon:active &,
&--search-icon:active:focus &,
&--search-icon.active &,
&--search-icon.active:focus & {
&__inner {
background: none;
box-shadow: none;
color: var(--ons-color-text-link-hover);
.ons-icon {
fill: var(--ons-color-text-link-hover);
}
}
}

&--search-icon:focus {
background-color: var(--ons-color-focus);
border-color: var(--ons-color-text-link-focus);
}

&--search-icon:focus &,
&--close:focus & {
&__inner {
background: none;
box-shadow: none;
.ons-icon {
fill: var(--ons-color-text-link-focus);
}
}
}

&--close:focus {
background: var(--ons-color-focus);
border-color: var(--ons-color-black);
}

&--search-icon:active {
background-color: var(--ons-color-branded-tint);
border-color: var(--ons-color-text-link-hover);
}

&--close:hover &,
&--close:active &,
&--close.active &,
&--close.active:focus &,
&--close:active:focus & {
&__inner {
background: none !important;
box-shadow: none;
color: var(--ons-color-text-link-hover);
.ons-icon {
fill: var(--ons-color-text-link-hover);
}
}
}
}

.ons-search__btn {
Expand Down
4 changes: 4 additions & 0 deletions src/components/button/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
{% set iconType = "loader" %}
{% set iconPosition = "after" %}
{% set variantClasses = " ons-btn--loader ons-js-loader ons-js-submit-btn" %}
{% elif 'search' in params.variants %}
{% set iconType = "search" %}
{% elif 'close' in params.variants %}
{% set iconType = "close" %}
{% endif %}
{% endif %}
{% set tag = "a" if params.url else "button" %}
Expand Down
20 changes: 18 additions & 2 deletions src/components/header/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@
}

&__org-logo--large {
@include mq('2xs', 454px) {
@include mq('2xs', 460px) {
display: none;
}
}

&__org-logo--small {
@include mq(455px) {
@include mq(461px) {
display: none;
}
}
Expand Down Expand Up @@ -278,6 +278,22 @@
}
}

&-nav-search {
background-color: var(--ons-color-branded-tint);
margin-bottom: 1rem;
@extend .ons-u-pt-2xl;
@extend .ons-u-pb-2xl;

width: 100%;
&__input {
border-bottom: 1px solid var(--ons-color-ocean-blue);
@extend .ons-u-mb-2xl;
@extend .ons-u-pb-2xl;

row-gap: 1rem;
}
}

.ons-btn {
top: 0 !important;
}
Expand Down
Loading