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 task solution #3866

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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://danil-maksimenko.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://danil-maksimenko.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
31 changes: 30 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,35 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>Search bar airbnb</h1>
<form
action="#"
class="search-form search-form--big"
data-qa="big"
>
<label class="search-form__label">
<span class="search-form__image search-form__image--big"></span>
Copy link

Choose a reason for hiding this comment

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

Just set all styles in this selectors to search-form__input, you don`t need this additional span here and in the small form

<input
type="text"
class="search-form__input search-form__input--big"

Choose a reason for hiding this comment

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

Suggested change
class="search-form__input search-form__input--big"
class="search-form__input"

you don't need --big modifier.
set all styles in .search-form__input selector and change necessary for --small modifier.
same for other elements

placeholder="Try &#34;Los Angeles&#34;"
data-qa="keypress"
>
</label>
</form>

<form
action="#"
class="search-form search-form--small"
data-qa="small"
>
<label class="search-form__label">
<span class="search-form__image search-form__image--small"></span>
<input
type="text"
class="search-form__input search-form__input--small"
placeholder="Try &#34;Los Angeles&#34;"
>
</label>
</form>
</body>
</html>
110 changes: 109 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,109 @@
/* add styles here */
@font-face {
font-family: Avenir;
src: url(fonts/Avenir-Book.ttf);
font-weight: 300;
}

@font-face {
font-family: Avenir;
src: url(fonts/Avenir-Heavy.ttf);
font-weight: 800;
}

:root {
--main-text-color: #3D4E61;

}

html {
font-family: Avenir, Arial, sans-serif;
font-size: 16px;
color: var(--main-text-color);
}

input {
Copy link

Choose a reason for hiding this comment

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

Set it in search-form__input

Copy link
Author

Choose a reason for hiding this comment

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

I need to set color: var(--main-text-colot) in search-form__input ?

Choose a reason for hiding this comment

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

do not style by tags. move all styles for input to .search-form__input selector.
box-sizing better to set in * selector

padding: 0;
outline: none;
border: none;
box-sizing: border-box;
}


.search-form {
width: 100%;
box-shadow: 0 1px 8px 0 rgba(61, 78, 97, 0.10);
border-radius: 4px;
}

.search-form:hover {
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.search-form--big {
height: 70px;
margin: 20px auto;
}

.search-form--small {
height: 42px;
}

.search-form__label {
width: 100%;
height: 100%;
display: flex;
align-items: center;
overflow: hidden;
position: relative;
}

.search-form__image {
background-image: url(images/Search.svg);
background-size: cover;
background-repeat: no-repeat;
}

.search-form__image--big {
width: 19px;
height: 19px;
position: absolute;
top: 25px;
left: 26px;
}

.search-form__image--small {
position: absolute;
width: 11px;
height: 11px;
top: 15px;
left: 13px;
}

.search-form__input {
height: 100%;
width: 100%;
border-radius: 4px;
border: 1px solid #E1E7ED;
background: #FFF;
color: var(--main-text-color);
font-family: inherit;
}

.search-form__input:focus {
background: linear-gradient(180deg, #FFF 0%, #F6F6F7 100%);
font-weight: 800;
}

.search-form__input::placeholder {
color: var(--main-text-color);
}

.search-form__input--big {
padding-left: 62px;
font-size: 16px;

Choose a reason for hiding this comment

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

move this styles in .search-form__input selector

}

.search-form__input--small {
padding-left: 33px;
font-size: 14px;
}