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

im trying #4540

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
9 changes: 5 additions & 4 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
"keywords": [],
"author": "Mate Academy",
"license": "GPL-3.0",
"dependencies": {},
"devDependencies": {
"@linthtml/linthtml": "^0.9.6",
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"backstopjs": "6.3.23",
"jest": "^29.7.0",
Expand Down
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://kami2693.github.io/layout_search-bar-airbnb/)
- [TEST REPORT LINK](https://kami2693.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
33 changes: 23 additions & 10 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,29 @@
/>
</head>
<body>
<input
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>
<form class="form">
<div
class="form__icon form__icon--big"
data-qa="big"
>
<input
class="input input__big"
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>

Choose a reason for hiding this comment

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

The class names 'input__big' and 'input__small' are not very descriptive. It's better to use class names that describe the meaning of the element, not its appearance. For example, if these inputs are for search, you could use 'search-input' instead.

</div>

<input
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>
<div
class="form__icon form__icon--small"
data-qa="small"
>
<input
type="text"
placeholder="Try “Los Angeles“"
class="input input__small"
/>

Choose a reason for hiding this comment

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

The input elements are missing the 'name' attribute. This attribute is important for form submission and accessibility.

</div>
</form>

Choose a reason for hiding this comment

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

It's recommended to use semantic HTML tags where possible. For example, the form could be wrapped in a section tag, which would give it more semantic meaning. Semantic tags help with accessibility and SEO.

</body>
</html>
89 changes: 88 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,88 @@
/* add styles here */
@font-face {
font-family: Avenir;
font-weight: 300;
src:
url(../src/fonts/Avenir-Book.ttf) format('truetype'),
url(../src/fonts/Avenir-Heavy.ttf) format('truetype');
}

Choose a reason for hiding this comment

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

It's better to split your font-face declarations into two separate ones for different font weights. It's a common practice to have a separate @font-face declaration for each font weight and style combination. This way, the browser can select the correct font file based on the font-weight and font-style used in your CSS rules.


body {
margin: 0 8px;
box-sizing: border-box;

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 better to add only top or bottom margins, but not both, to avoid potential margin collapse. In your case, you've added both vertical and horizontal margins to the body. It's not a critical issue in this case, but it's a good practice to follow.

padding-top: 20px;
}

.form {
display: flex;
flex-direction: column;
gap: 20px;
position: relative;
}

.input {
box-sizing: border-box;
width: 100%;
border: 1px solid #e1e7ed;
border-radius: 4px;
color: #3d4e61;
font-family: Avenir, Arial, sans-serif;
font-weight: 300;

Choose a reason for hiding this comment

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

Remember to use fallback fonts - alternative font-family in case the main one doesn't work. If the Avenir font fails to load for some reason, your text will be displayed using the default browser font, which may not look as expected. It's a good practice to specify a list of fallback fonts that should be used if the primary font is not available. You can specify a list of fonts in order of preference, separated by commas. After Arial, you can add 'sans-serif' as a generic fallback.

}

.input__big {
height: 70px;
font-size: 16px;
line-height: 21.86px;
padding: 0 0 0 62px;
}

.input__small {
height: 42px;
font-size: 14px;
padding-left: 33px;
line-height: 19.12px;
}

.form__icon::before {
content: '';
position: absolute;
background-image: url(/src/images/Search.svg);
background-size: contain;
background-repeat: no-repeat;
}

.form__icon--big::before {
width: 20px;
height: 20px;
top: 25px;
left: 26px;
}

.form__icon--small::before {
width: 11px;
height: 11px;
bottom: 16px;
left: 13px;
}

.input__big:hover {
box-shadow: 0 4px 4px #3d4e6133;
transition: box-shadow 0.3s;
}

Choose a reason for hiding this comment

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

The transition property should be placed in the original selector, not in the hover or focus state. It's a common practice to include the transition property in the original class, so that the transition is smooth both ways - when the pseudo-class is activated and when it's deactivated.


.input__small:hover {
box-shadow: 0 4px 4px #3d4e6133;
transition: box-shadow 0.3s;
}

Choose a reason for hiding this comment

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

The transition property should be placed in the original selector, not in the hover state. Refer to the comment above for more details.


.input__big:focus {
text-shadow: 0 3px 3px #bbbec2;
box-shadow: 0 4px 4px #3d4e6133;
transition: box-shadow 0.3s;
}

Choose a reason for hiding this comment

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

The transition property should be placed in the original selector, not in the focus state. Refer to the comment above for more details.


.input__small:focus {
text-shadow: 0 3px 3px #bbbec2;
box-shadow: 0 4px 4px #3d4e6133;
transition: box-shadow 0.3s;
}

Choose a reason for hiding this comment

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

The transition property should be placed in the original selector, not in the focus state. Refer to the comment above for more details.

Loading