-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
search-bar ver 1.0.0 #4409
base: master
Are you sure you want to change the base?
search-bar ver 1.0.0 #4409
Conversation
Farrelzum
commented
Aug 3, 2024
- DEMO LINK
- TEST REPORT LINK
src/style.css
Outdated
} | ||
|
||
.search-bar_big { | ||
height: 68px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/style.css
Outdated
.search-bar_big__form:focus { | ||
margin-top: 25px; | ||
max-height: 22px; | ||
|
||
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%); | ||
|
||
font-weight: bold; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/index.html
Outdated
/> | ||
<form class="search"> | ||
<div | ||
class="search search-bar_big" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need divs inside forms (remember to move data-qa to form)
src/index.html
Outdated
> | ||
<input | ||
type="text" | ||
class="search-bar_big__form" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to simplify class name
src/style.css
Outdated
.search-bar_big__form:placeholder-shown { | ||
max-height: 22px; | ||
margin-top: 21px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to center it so it works regardless of search bar height
src/style.css
Outdated
input.search-bar_big__form { | ||
font-weight: 500; | ||
margin-bottom: 2px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey. There is a lot repeated code. Make use of BEM modifiers to keep your code DRY and use SCSS nesting.
src/style.css
Outdated
position: relative; | ||
} | ||
|
||
.search_big { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's supposed to be modifier - .search--big
display: flex; | ||
position: relative; | ||
box-sizing: border-box; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also use those styles in .search__small
. You can move it to the .search
selector. Keep your code DRY
src/style.css
Outdated
.search__small:hover { | ||
box-shadow: 0 3px 8px 0 rgba(61, 78, 97, 0.2); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the same as for .search_big:hover
background-image: url('./images/Search.svg'); | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: contain; | ||
content: ''; | ||
position: absolute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those styles also are reapeated.
src/style.css
Outdated
.search__input_big { | ||
padding-left: 62px; | ||
height: 100%; | ||
width: 100%; | ||
line-height: 21px; | ||
outline: none; | ||
box-sizing: border-box; | ||
border: 1px solid rgba(225, 231, 237, 1); | ||
border-radius: 4px; | ||
box-shadow: 0 1px 8px 0 rgba(61, 78, 97, 0.1); | ||
|
||
font-family: Avenir, sans-serif; | ||
font-size: 16px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also create element .search__input
and then use modifier ...--big and ..--small. This way you can remove repeated code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some old code that is no longer used, but I think I can approve it. Remember to delete unused code after refactoring! Great job with the implementation.
.search__input_big:focus { | ||
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%); | ||
|
||
font-weight: bold; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to delete this one.
.search__input_small:focus { | ||
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
background: linear-gradient(180deg, #fff 0%, #f6f6f7 100%); | ||
|
||
font-weight: bold; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one also