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-bar #4466

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ___

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_search-bar-airbnb/report/html_report/)
- [DEMO LINK](https://<SerhiyPaziyc.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://SerhiyPaziyc.github.io/layout_search-bar-airbnb/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
46 changes: 36 additions & 10 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,42 @@
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<div
class="search"
data-qa="big"
>
<button class="search__button">
<img
class="search__img search__img--big"
src="/src/images/Search.svg"
alt="Search icon"
/>
</button>
<input
class="search__txt search--big"
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
</div>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<div
class="search"
data-qa="small"
>
<button class="search__button">
<img
class="search__img search__img--small"
src="/src/images/Search.svg"
alt="Search icon"
/>
</button>
<input
class="search__txt search--small"
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
</div>
</body>
</html>
84 changes: 83 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,83 @@
/* add styles here */
@font-face {
font-family: Avenir;
src: url(/src/fonts/Avenir.ttc);
}

body {
font-family: Avenir, Arial, Helvetica, sans-serif;
}

.search {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
border-radius: 4px;

Choose a reason for hiding this comment

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

Be consistent with your margins. It's recommended to add only top or bottom margins, but not both, to avoid potential margin collapse issues. In this case, you have only a top margin, which is fine, but ensure that the rest of your elements follow this practice as well.

border: 1px solid #e1e7ed;
box-shadow: 0 1px 8px 0 #3d4e611a;
transition: box-shadow 0.3s ease;
}

.search:hover,
.search:focus-within {
box-shadow: 0 4px 4px #3d4e611a;
}

.search__txt {
padding: 0;
border: none;
outline: none;
color: #3d4e61;
width: 100%;
font-size: 16px;
}

.search__txt:focus {
font-weight: bold;
}

.search::placeholder {
color: #3d4e61;
}

.search--big::placeholder,
.search--small::placeholder {
font-family: Avenir, Arial, Helvetica, sans-serif;
color: #3d4e61;
}

.search--big {
height: 68px;
font-size: 16px;
}

.search--small {
height: 40px;
font-size: 14px;
}

.search__button {
border: none;
background-color: #fff;
padding: 0;
}

.search__img {
display: flex;
align-items: center;
justify-content: center;
}

.search__img--big {
width: 19px;
height: 19px;
margin-right: 17px;
margin-left: 26px;
}

.search__img--small {
width: 11px;
height: 11px;
margin-right: 9px;
margin-left: 13px;
}
Loading