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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BD-46] fix: styles for searchfield btn #2702

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SearchField/SearchFieldSubmitButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function SearchFieldSubmitButton(props) {
) : (
<button
type="submit"
className={classNames('btn')}
className={classNames('btn pgn__searchfield__action-btn')}
ref={refs.submitButton}
disabled={disabled}
{...others}
Expand Down
2 changes: 1 addition & 1 deletion src/SearchField/__snapshots__/SearchField.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<SearchField /> with basic usage should match the snapshot 1`] = `"<div class=\\"pgn__searchfield d-flex\\"><form role=\\"search\\" class=\\"pgn__searchfield-form\\"><label for=\\"pgn-searchfield-input-1\\" class=\\"m-0\\"><span class=\\"sr-only\\">search</span></label><input type=\\"text\\" class=\\"form-control\\" role=\\"searchbox\\" id=\\"pgn-searchfield-input-1\\" name=\\"searchfield-input\\" value=\\"\\"/><button type=\\"submit\\" class=\\"btn\\"><span class=\\"pgn__icon\\"><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" focusable=\\"false\\" aria-hidden=\\"true\\"><path d=\\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z\\" fill=\\"currentColor\\"></path></svg></span><span class=\\"sr-only\\">submit search</span></button></form></div>"`;
exports[`<SearchField /> with basic usage should match the snapshot 1`] = `"<div class=\\"pgn__searchfield d-flex\\"><form role=\\"search\\" class=\\"pgn__searchfield-form\\"><label for=\\"pgn-searchfield-input-1\\" class=\\"m-0\\"><span class=\\"sr-only\\">search</span></label><input type=\\"text\\" class=\\"form-control\\" role=\\"searchbox\\" id=\\"pgn-searchfield-input-1\\" name=\\"searchfield-input\\" value=\\"\\"/><button type=\\"submit\\" class=\\"btn pgn__searchfield__action-btn\\"><span class=\\"pgn__icon\\"><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" focusable=\\"false\\" aria-hidden=\\"true\\"><path d=\\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z\\" fill=\\"currentColor\\"></path></svg></span><span class=\\"sr-only\\">submit search</span></button></form></div>"`;
14 changes: 7 additions & 7 deletions src/SearchField/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
background-color: $search-form-background-color;
}

.btn:focus-visible {
.pgn__searchfield__action-btn:focus {
outline: none;
position: relative;
transition: $input-transition;

&::after {
&::before {
content: "";
border: $search-border-focus-width double $search-border-focus-color;
border: $search-border-focus-width solid $search-border-focus-color;
position: absolute;
width: 100%;
height: 100%;
top: -5px;
right: -5px;
bottom: -5px;
left: -5px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

Expand Down Expand Up @@ -138,6 +139,5 @@
}

.pgn__searchfield__button.btn[type="submit"] {
border-radius: 0;
margin-inline-start: $search-button-margin;
}