-
Notifications
You must be signed in to change notification settings - Fork 4k
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 #4484
base: master
Are you sure you want to change the base?
add task solution #4484
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,23 +10,39 @@ | |
http-equiv="X-UA-Compatible" | ||
content="ie=edge" | ||
/> | ||
<title>Document</title> | ||
<title>Search bar</title> | ||
<link | ||
rel="stylesheet" | ||
href="style.css" | ||
/> | ||
</head> | ||
<body> | ||
<input | ||
type="text" | ||
data-qa="keypress" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<form | ||
action="#" | ||
data-qa="big" | ||
> | ||
<label> | ||
<input | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a |
||
class="search-bar search-bar__big" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
type="text" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class names should represent the meaning of the content, not the styles or tag names. The class name 'search-bar__big' suggests a BEM naming convention but is being used to indicate the size. Consider a more meaningful name that describes the purpose or context instead of the size. |
||
data-qa="keypress" | ||
placeholder="Try “Los Angeles“" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class names should represent the meaning of the content, not the styles or tag names. The class |
||
/> | ||
</label> | ||
</form> | ||
|
||
<input | ||
type="text" | ||
data-qa="hover" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<form | ||
action="#" | ||
data-qa="small" | ||
> | ||
Comment on lines
+42
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep your attributes correctly formatted. If the element has more than 2 attributes, start each one on a new line with a 2-space indentation related to the tag. |
||
<label> | ||
<input | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
class="search-bar search-bar__small" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous comment, 'search-bar__small' should be replaced with a class name that reflects the function or context of the element rather than its size. |
||
type="text" | ||
data-qa="hover" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
</label> | ||
</form> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be empty lines between sibling form blocks to simplify reading and add some "air" to the code structure. |
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,84 @@ | ||
/* 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: bold; | ||
} | ||
|
||
.search-bar { | ||
font-family: Avenir, sans-serif; | ||
display: block; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a fallback font family after 'Avenir'. If 'Avenir' fails to load for some reason, the browser will use the fallback font instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a fallback font-family for Avenir in case it fails to load. For example, 'font-family: Avenir, Arial, sans-serif;'. This ensures text is still readable with a default font. |
||
box-sizing: border-box; | ||
width: 100%; | ||
|
||
margin-top: 20px; | ||
border: 1px solid #e1e7ed; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the checklist, be consistent with your margins. Choose either top or bottom margins for elements, but not both, to avoid potential margin collapse issues. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the checklist, be consistent with your margins. It's recommended to add margins only to the top or bottom of elements, not both, to avoid potential margin collapse. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
border-radius: 4px; | ||
box-shadow: 0 1px 8px 0 #3d4e611a; | ||
color: #3d4e61; | ||
} | ||
|
||
.search-bar::placeholder { | ||
color: #3d4e61; | ||
} | ||
|
||
.search-bar__big { | ||
height: 70px; | ||
background-image: url(images/Search.svg); | ||
background-repeat: no-repeat; | ||
background-size: 19px 19px; | ||
font-size: 16px; | ||
padding-left: 62px; | ||
background-position: 26px center; | ||
background-color: #ffff; | ||
} | ||
|
||
.search-bar__big:hover { | ||
box-shadow: 0 3px 8px 0 #3d4e6133; | ||
} | ||
|
||
.search-bar__big:focus { | ||
border: 1px solid #e1e7ed; | ||
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25); | ||
|
||
background-image: url('./images/Search.svg'), | ||
linear-gradient(180deg, transparent, #f6f6f7); | ||
|
||
background-repeat: no-repeat; | ||
background-position: 26px 25px; | ||
background-size: 19px 19px; | ||
text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25); | ||
font-weight: bold; | ||
} | ||
|
||
.search-bar__small { | ||
height: 42px; | ||
background-image: url(images/Search.svg); | ||
background-repeat: no-repeat; | ||
background-size: 11px 11px; | ||
font-size: 14px; | ||
font-weight: 400; | ||
padding-left: 33px; | ||
background-position: 13px center; | ||
} | ||
|
||
.search-bar__small:hover { | ||
box-shadow: 0 3px 8px 0 #3d4e61; | ||
text-shadow: none; | ||
} | ||
|
||
.search-bar__small:focus { | ||
border: 1px solid #e1e7ed; | ||
text-shadow: none; | ||
background-image: url(/src/images/Search.svg), | ||
linear-gradient(180deg, transparent, #f6f6f7); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure the path to the image is consistent across the CSS file. Here, the path starts with '/src/images/Search.svg', while elsewhere it is 'images/Search.svg'. Use a consistent path to ensure the image loads correctly in all cases. |
||
|
||
background-repeat: no-repeat; | ||
background-position: 13px center; | ||
background-size: 11px 11px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep your attributes correctly formatted. If the element has more than 2 attributes, start each one on a new line with a 2-space indentation related to the tag.