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

Develop #3852

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

Develop #3852

Show file tree
Hide file tree
Changes from 18 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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"@mate-academy/bemlint": "^0.1.1",
"@mate-academy/eslint-config": "*",
"@mate-academy/linthtml-config": "*",
"@mate-academy/stylelint-config": "*",
"@mate-academy/scripts": "^1.2.8",
"@parcel/transformer-sass": "^2.10.2",
"@mate-academy/scripts": "^1.2.12",
"@mate-academy/stylelint-config": "^0.0.11",
"@parcel/transformer-sass": "2.10.2",
"backstopjs": "^6.2.2",
"eslint": "^8.52.0",
"eslint-plugin-node": "^11.1.0",
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ ___

❗️ 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://m-bayrak.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://m-bayrak.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.

- [ ] Icon implemented using background-image CSS property
- [ ] Inputs are written inside of 'form' tag with correctly passed attributes
- [ ] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] Icon implemented using background-image CSS property
- [x] Inputs are written inside of 'form' tag with correctly passed attributes
- [x] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
23 changes: 22 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>Search bar airbnb</h1>

<form data-qa="big">
<div class="search-bar search-bar--larger" tabindex="1">

Choose a reason for hiding this comment

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

it is redundant to make search-bar--larger modifier for big form. set all styles in search-bar and change necessary in search-bar-mini modifier for small form.
same for other elements.

Copy link
Author

Choose a reason for hiding this comment

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

but in this case the CSS file will become larger because many identical lines will appear

Copy link
Author

Choose a reason for hiding this comment

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

Mant thx for comments

<div class="icon icon--search"></div>
<input
class="input input--larger"
type="text"
placeholder="Try “Los Angeles”"
data-qa="keypress">
</div>
</form>

<form data-qa="small">
<div class="search-bar search-bar--mini" tabindex="1">
<div class="icon icon--search-mini"></div>
<input
class="input input--mini"
type="text"
placeholder="Try “Los Angeles”">
</div>
</form>

</body>
</html>
109 changes: 108 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,108 @@
/* add styles here */
* {
box-sizing: border-box;
}

:root {
--color: #3d4e61;
--border-color: #e1e7ed;
--main-bs-color: rgba(61, 78, 97, 0.1);
}

html {
padding: 0;
font-family: Avenir, sans-serif;
}

@font-face {
font-family: Avenir;
src: url("./fonts/Avenir-Book.ttf");
}

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

/* #region larger search bar & identical search bars code */

.search-bar {
display: flex;
align-items: center;

background-color: #FFF;
border: 1px solid var(--border-color);
border-radius: 4px;
}

.search-bar--larger {
margin: 20px 0;
height: 70px;
}

.icon {
background-image: url(./images/Search.svg);
background-repeat: no-repeat;
background-position: center;
background-size: contain;
}

.icon--search {
width: 19px;
height: 19px;
margin: 0 16px 0 25px;
}

.input {
font-family: inherit;
font-weight: 300;
width: 85%;
height: 100%;
outline: none;
border: 0;
background: none;
color: var(--color);
}

.input--larger {
font-size: 16px;
}

.input::placeholder {
color: var(--color);
}

/* #endregion */

/* #region smaller search bar */

.search-bar--mini {
min-height: 42px;
}

.icon--search-mini {
width: 11px;
height: 11px;
margin: 0 7px 0 13px;
}

.input--mini {
font-size: 14px;
}

/* #endregion */

.search-bar:hover {
border-radius: 4px;
border: 1px solid #E1E7ED;
box-shadow: 0 3px 8px 0 rgba(61, 78, 97, 0.20);
}

.search-bar:focus-within {
background: linear-gradient(180deg, #FFF 0%, #F6F6F7 100%);
}

.input:focus {
background: none;
font-weight: 900;

Choose a reason for hiding this comment

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

tru do not set font-weight for focus. looks like such font styles should be for input, and for placeholder set font styles that in design. it can help fix tests.

Copy link
Author

Choose a reason for hiding this comment

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

the bugs are fixed and the test is now working

text-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}