-
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
Develop #4532
base: master
Are you sure you want to change the base?
Develop #4532
Changes from 5 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,28 @@ | |
/> | ||
</head> | ||
<body> | ||
<input | ||
type="text" | ||
data-qa="keypress" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<form | ||
class="search-bar primary-search-bar" | ||
data-qa="big" | ||
> | ||
<input | ||
class="search-bar-input search-bar-input--primary" | ||
type="text" | ||
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. Good job using the |
||
/> | ||
</form> | ||
|
||
<input | ||
type="text" | ||
data-qa="hover" | ||
placeholder="Try “Los Angeles“" | ||
/> | ||
<form | ||
class="search-bar secondary-search-bar" | ||
data-qa="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. Same comment as above for |
||
> | ||
<input | ||
class="search-bar-input search-bar-input--secondary" | ||
type="text" | ||
data-qa="hover" | ||
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. Same comment as above for the placeholder text. |
||
/> | ||
</form> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,71 @@ | ||
/* add styles here */ | ||
body { | ||
font-family: Avenir, 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. It's better to specify a fallback font in case the main one doesn't load. You can add a generic font family such as 'sans-serif' to the end of your font stack. Also, be sure to include 'Avenir-Book' and 'Avenir-Heavy' in your font stack if you're using them elsewhere in your CSS. 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. This line doesn't provide fallback fonts. Remember to use fallback fonts - alternative font-family in case the main one doesn't work. In case 'Avenir' font fails to load, the browser will use the generic 'sans-serif' font. However, it would be better to specify one or two more specific fallback fonts before resorting to the generic 'sans-serif'. For example, 'Helvetica' and 'Arial' are commonly used fallbacks for 'Avenir'. (CHECKLIST: Remember to use fallback fonts - alternative font-family in case the main one doesn't work) |
||
color: #3d4e61; | ||
} | ||
|
||
@font-face { | ||
font-family: Avenir-Book; | ||
font-style: normal; | ||
font-weight: normal; | ||
src: url(./fonts/Avenir-Book.ttf); | ||
} | ||
|
||
@font-face { | ||
font-family: Avenir-Heavy; | ||
src: url(./fonts/Avenir-Heavy.ttf); | ||
} | ||
|
||
.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. According to the checklist, it's better to be consistent with your margins. You should only add top or bottom margins, but not both. Here, you're adding a top margin, which may lead to unexpected layout shifts if other elements also have bottom margins. 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. You have used top margin here. Stick to either top or bottom margins for consistency and to avoid potential margin collapses. (CHECKLIST: Be consistent with your margins (Add only top or bottom, but not both)) 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 set the top margin for the '.search-bar' class. However, it would be more consistent if you add margins to the bottom of elements, not to the top. This helps to avoid potential margin collapse. (Checklist: Be consistent with your margins (Add only top or bottom, but not both)) |
||
|
||
.secondary-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. The same comment about margins applies here. It's better to be consistent and only add top or bottom margins, but not both. 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. Again, you have used top margin here. As mentioned before, it's better to stick to either top or bottom margins for consistency and to avoid potential margin collapses. (CHECKLIST: Be consistent with your margins (Add only top or bottom, but not both)) 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 set the top margin for the '.additional-search-bar' class. As mentioned above, it would be more consistent if you add margins to the bottom of elements, not to the top. (Checklist: Be consistent with your margins (Add only top or bottom, but not both)) |
||
|
||
.search-bar-input { | ||
width: 100%; | ||
height: 100%; | ||
background-image: url(./images/Search.svg); | ||
background-repeat: no-repeat; | ||
border: 1px solid #e1e7ed; | ||
border-radius: 4px; | ||
box-shadow: 0 1px 8px 0 #3d4e611a; | ||
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's better to use classes for styling instead of tag names, unless the tag is 'html' or 'body'. Here, you're styling the 'input' tag directly, which could cause conflicts if you have other 'input' elements on your page that need different styles. |
||
} | ||
|
||
.search-bar-input--primary { | ||
font-family: Avenir-Book, sans-serif; | ||
height: 70px; | ||
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 'font-family' property in the '.search-bar-input--main' class should include fallback fonts. (Checklist: Remember to use fallback fonts - alternative font-family in case the main one doesn't work) |
||
box-sizing: border-box; | ||
background-size: 19px 19px; | ||
background-position: 26px center; | ||
padding-left: 62px; | ||
font-size: 16px; | ||
line-height: 21.86px; | ||
} | ||
|
||
.search-bar-input--secondary { | ||
font-family: Avenir-Book, sans-serif; | ||
height: 42px; | ||
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 'font-family' property in the '.search-bar-input--additional' class should include fallback fonts. (Checklist: Remember to use fallback fonts - alternative font-family in case the main one doesn't work) |
||
box-sizing: border-box; | ||
background-size: 11px 11px; | ||
background-position: 13px center; | ||
padding-left: 33px; | ||
font-size: 14px; | ||
line-height: 19.12px; | ||
} | ||
|
||
.search-bar-input::placeholder { | ||
color: #3d4e61; | ||
} | ||
|
||
.search-bar-input:hover { | ||
box-shadow: rgba(0, 0, 0, 0.25); | ||
} | ||
|
||
.search-bar-input:focus { | ||
box-shadow: rgba(0, 0, 0, 0.25); | ||
font-family: Avenir-Heavy, sans-serif; | ||
outline: none; | ||
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're changing the 'font-family' on focus, which could cause a noticeable and potentially disorienting change for the user. It's better to keep the 'font-family' consistent across different states. 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 'font-family' property in the '.search-bar-input:focus' class should include fallback fonts. (Checklist: Remember to use fallback fonts - alternative font-family in case the main one doesn't work) |
||
} |
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.
You've used the class names
search-bar
andprimary-search-bar
here. Class names should be semantic and describe the meaning of the content, not the styles or tag names. Consider renamingprimary-search-bar
to something more descriptive of its function or content, for examplemain-search-bar
.