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

search-bar ver 1.0.0 #4409

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Farrelzum
Copy link

src/style.css Outdated
}

.search-bar_big {
height: 68px;

Choose a reason for hiding this comment

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

total height should be 70px so you need to include border (box-sizing: border-box) and change style to 70px
same for small search
image

src/style.css Outdated
Comment on lines 51 to 59
.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;
}

Choose a reason for hiding this comment

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

on focus:

  • there shouldn't be any border
    image
  • when you start typing the entire input moves down slightly
  • input should be the size of search bar because now you add e.g background gradient only for this small fragment
    image

src/index.html Outdated
/>
<form class="search">
<div
class="search search-bar_big"

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"

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
Comment on lines 61 to 64
.search-bar_big__form:placeholder-shown {
max-height: 22px;
margin-top: 21px;
}

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
Comment on lines 70 to 73
input.search-bar_big__form {
font-weight: 500;
margin-bottom: 2px;
}

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

Copy link

@Zibi95 Zibi95 left a 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 {
Copy link

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

Comment on lines +16 to +18
display: flex;
position: relative;
box-sizing: border-box;
Copy link

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
Comment on lines 69 to 71
.search__small:hover {
box-shadow: 0 3px 8px 0 rgba(61, 78, 97, 0.2);
}
Copy link

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

Comment on lines +26 to +31
background-image: url('./images/Search.svg');
background-position: center;
background-repeat: no-repeat;
background-size: contain;
content: '';
position: absolute;
Copy link

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
Comment on lines 38 to 51
.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;
}
Copy link

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.

@Farrelzum Farrelzum requested a review from Zibi95 August 17, 2024 10:28
Copy link

@Zibi95 Zibi95 left a 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.

Comment on lines +65 to +70
.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;
}
Copy link

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.

Comment on lines +84 to +89
.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;
}
Copy link

Choose a reason for hiding this comment

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

This one also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants