-
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 #4479
base: master
Are you sure you want to change the base?
add task solution #4479
Changes from all commits
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 |
---|---|---|
|
@@ -17,16 +17,30 @@ | |
/> | ||
</head> | ||
<body> | ||
<input | ||
type="text" | ||
data-qa="keypress" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<header class="search-container"> | ||
<form | ||
class="search-bar top-search-bar" | ||
data-qa="big" | ||
> | ||
<input | ||
class="search-bar-input search-bar-input--top" | ||
type="text" | ||
data-qa="keypress" | ||
placeholder="Try “Los Angeles“" | ||
Comment on lines
+21
to
+29
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 attributes in the |
||
/> | ||
</form> | ||
Comment on lines
+20
to
+31
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 an empty line between the |
||
|
||
<input | ||
type="text" | ||
data-qa="hover" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<form | ||
class="search-bar bottom-search-bar" | ||
data-qa="small" | ||
> | ||
<input | ||
class="search-bar-input search-bar-input--bottom" | ||
type="text" | ||
data-qa="hover" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
Comment on lines
+33
to
+42
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 attributes in the |
||
</form> | ||
</header> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,73 @@ | ||
/* add styles here */ | ||
@font-face { | ||
font-family: Avenir-Book; | ||
src: url(./fonts/Avenir-Book.ttf); | ||
} | ||
|
||
@font-face { | ||
font-family: Avenir-Heavy; | ||
src: url(./fonts/Avenir-Heavy.ttf); | ||
font-weight: 900; | ||
} | ||
|
||
* { | ||
font-family: Avenir-Book, Arial, Helvetica, sans-serif; | ||
font-weight: 300; | ||
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. Remember to use fallback fonts. It's good you have Arial and Helvetica, but you should also include a generic family like 'sans-serif' at the end. |
||
font-style: normal; | ||
color: rgba(61, 78, 97, 1); | ||
box-sizing: border-box; | ||
} | ||
Comment on lines
+12
to
+17
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 '' selector impacts performance and should not be used. It's better to set styles specifically for elements that require them. Also, avoid setting global font styles on the '' selector; use 'body' or specific classes instead.
Comment on lines
+12
to
+17
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. Avoid using the |
||
|
||
body { | ||
margin-top: 0; | ||
} | ||
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 by adding only top or bottom, but not both. It seems you have set the top margin here, ensure that you're not also setting the bottom margin elsewhere for the same element to avoid potential margin collapse. |
||
|
||
Comment on lines
+20
to
+22
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. Be consistent with your margins. Add only top or bottom margins, but not both, to avoid potential margin collapse issues. |
||
.search-bar { | ||
margin-top: 20px; | ||
} | ||
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. Following the same principle as the previous comment, ensure that you're not setting both top and bottom margins for elements to avoid potential margin collapse issues. |
||
|
||
Comment on lines
+24
to
+26
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. You have a margin-top on the .search-bar class. If there are no specific requirements for the container size, consider letting the content size dictate the spacing instead of fixing it with margins. |
||
.search-bar-input { | ||
width: 100%; | ||
height: 100%; | ||
background-image: url(images/Search.svg); | ||
background-repeat: no-repeat; | ||
border-radius: 4px; | ||
border: 1px solid #e1e7ed; | ||
box-shadow: 0 1px 8px 0 #3d4e611a; | ||
box-sizing: border-box; | ||
} | ||
|
||
Comment on lines
+28
to
+37
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. Avoid fixing container sizes like width and height unless required. Let the content size dictate the container size to avoid overflow or accidental scroll bars. |
||
.top-search-bar { | ||
height: 70px; | ||
} | ||
|
||
.bottom-search-bar { | ||
height: 42px; | ||
} | ||
|
||
.search-bar-input--top { | ||
padding-left: 62px; | ||
background-position: 26px center; | ||
background-size: 19px 19px; | ||
font-size: 16px; | ||
} | ||
|
||
.search-bar-input--bottom { | ||
padding-left: 33px; | ||
background-position: top 15px left 13px; | ||
background-size: 11px 11px; | ||
font-size: 14px; | ||
} | ||
|
||
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. It is recommended not to fix container sizes unless there's a specific requirement for it. Ensure that the fixed heights for the '.search-bar-input--top' and '.search-bar-input--bottom' are indeed necessary and that the content does not overflow or create an accidental scrollbar. |
||
.search-bar-input::placeholder { | ||
color: #3d4e61; | ||
} | ||
|
||
.search-bar-input:hover { | ||
box-shadow: 0 3px 8px 0 #3d4e6133; | ||
} | ||
|
||
.search-bar-input:focus { | ||
outline: none; | ||
font-family: Avenir-Heavy, Arial, Helvetica, sans-serif; | ||
box-shadow: 0 4px 4px 0 #00000040; | ||
} |
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.
The
alt
attribute is missing on the input element. Although it's not required for input elements, if you had images, remember to provide meaningfulalt
text for images.