-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 solution #5350
base: master
Are you sure you want to change the base?
add solution #5350
Conversation
oandriitsiv
commented
Sep 11, 2024
- DEMO LINK
- TEST REPORT LINK
- Header height is set in 1 place (for the links)
- Content is vertically centered (for any header height)
- CSS is used to show all letters in Uppercase (don't type them in HTML)
- Logo is an image wrapped with a link
- CSS Variable is used for a blue color
- [x Pseudo-element is used for a blue line below the active link
- Code follows all the [Code Style Rules ❗️]
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.
Hey there! Good effort on the code, but we've got a few important issues to address before we can merge your pull request. 🛠️ There are some typos and best practices that need to be corrected, like the class names and the use of tag names for styling. These changes are crucial for maintaining code consistency and readability. Also, don't forget to add a fallback font-family and to keep an eye on the line length for better readability. Keep up the good work, and with these adjustments, your code will be in great shape! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
src/index.html
Outdated
<header class="container"> | ||
<a | ||
href="index.html" | ||
class="logo" | ||
> | ||
<img | ||
src="./images/logo.png" | ||
alt="Logo" | ||
/> |
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.
Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. For example, add an empty line before the
element on line 30.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.
Add empty line before the element on line 30.
src/index.html
Outdated
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="is-activ nav__link" |
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.
Don't use spaces in <a>
tag's href
property. Also, ensure that class names represent the meaning of the content. The class name 'is-activ' seems to be a typo and should be 'is-active' if it's meant to indicate the active state.
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.
Delete spaces in tag's href property. Fixed the error in the class name 'is-active'
class="nav__link" | ||
data-qa="hover" | ||
> | ||
LAPTOPS & COMPUTERS |
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.
Lines of code should have 80 characters max for better readability. The text inside the tag on line 62 is too long and should be broken into multiple lines if necessary.
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.
Text inside the tag on line 62 cannot be broken.
@@ -1,3 +1,70 @@ | |||
body { | |||
font-family: Roboto, sans-serif; |
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.
Consider adding a fallback font-family in case 'Roboto' fails to load for some reason. For example, 'sans-serif' can be a good fallback.
src/style.css
Outdated
margin: 0; | ||
} | ||
|
||
.logo.png { |
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.
Avoid using tag names for styling. Use class selectors instead. The .logo.png
looks like a filename, not a class name.
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.
changed name class .logo
src/style.css
Outdated
margin-left: 50px; | ||
} | ||
|
||
.nav_item { |
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.
It seems there is a typo in the class name .nav_item
. According to the naming convention used in the rest of the file, it should be .nav__item
.
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.
Corrected the typo in the class .nav__item
src/style.css
Outdated
position: relative; | ||
} | ||
|
||
.nav__link.is-activ { |
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 class .nav__link.is-activ
seems to have a typo. If it's meant to indicate the active state, it should be .nav__link.is-active
.
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.
Corrected the typo in the class .nav__link.is-active
src/style.css
Outdated
height: 4px; | ||
content: ''; | ||
background-color: #00acdc; | ||
border-color: #00acdc; |
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 border-color
property in .nav__link.is-activ::after
is redundant since this pseudo-element does not have a border. You can remove this property.
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.
delete property the border-color.
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.
Great work on your Pull Request! 🌟 I've decided to approve it because there are no critical issues that impact the functionality or security of your code. However, please take note of the suggestions made to enhance your code's readability, maintainability, and responsiveness. Keep up the good coding practices, and remember to always consider fallback options and accessibility. Happy coding! 💻
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<h1>Moyo header</h1> | ||
<header class="container"> | ||
<a | ||
href="index.html" |
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.
Don't use spaces in <a>
tag's href
property. Anchor links should start with the #
symbol if they are meant to be page anchors. If this is meant to be a link to the homepage, consider using /
for clarity.
> | ||
<img | ||
src="./images/logo.png" | ||
alt="logo-moyo" |
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 should describe the image content. Instead of 'logo-moyo', a more descriptive alternative text like 'Moyo company logo' would be more informative.
</a> | ||
|
||
<nav class="nav"> | ||
<ul class="nav__list"> |
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.
Add empty lines between multiline sibling blocks of HTML for better readability. In this case, add an empty line before the <nav>
tag to separate it from the <header>
tag.
@@ -1,3 +1,69 @@ | |||
body { | |||
font-family: Roboto, sans-serif; |
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.
Consider adding a fallback font-family for Roboto to ensure text is displayed with a default sans-serif font if Roboto fails to load.
src/style.css
Outdated
|
||
.container { | ||
display: flex; | ||
height: 60px; |
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.
Avoid fixing the container size unless it's a specific requirement. It's better to let the content determine the height to prevent overflow or accidental scroll bars.
src/style.css
Outdated
|
||
.nav__list { | ||
display: flex; | ||
width: 1200px; |
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.
It's not recommended to set a fixed width for elements such as '.nav__list' unless it's a specific requirement. Consider using max-width or relative units like percentages to maintain responsiveness.
} | ||
|
||
.nav__item { | ||
display: block; |
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 '.nav__item' class has a 'display: block;' property which is unnecessary since
} | ||
|
||
.nav__link.is-active { | ||
display: inline-block; |
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 '.nav__link.is-active' class has a 'display: inline-block;' property which might not be necessary. If you're trying to override a previous 'display' value, ensure it's required; otherwise, it can be removed.
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.
src/index.html
Outdated
@@ -17,6 +17,78 @@ | |||
/> | |||
</head> | |||
<body> | |||
<h1>Moyo header</h1> | |||
<header class="container"> |
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.
<header class="container"> | |
<header class="header"> |
src/index.html
Outdated
</li> | ||
<li class="nav__item"> |
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.
Add the blank line between the links
</li> | |
<li class="nav__item"> | |
</li> | |
<li class="nav__item"> |
font-family: Roboto, sans-serif; | ||
font-size: 12px; |
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.
Move font styles to the html selector
font-family: Roboto, sans-serif; | ||
font-size: 12px; | ||
|
||
--hover-color: #00acdc; |
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.
Create a variable with :root
selector
src/style.css
Outdated
.container { | ||
display: flex; | ||
height: 60px; | ||
align-items: center; | ||
align-content: space-around; | ||
margin: 0; | ||
} |
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.
.container { | |
display: flex; | |
height: 60px; | |
align-items: center; | |
align-content: space-around; | |
margin: 0; | |
} | |
.header { | |
display: flex; | |
align-items: center; | |
justify-content: space-between; | |
padding: 0 50px; | |
box-sizing: border-box; | |
} |
src/style.css
Outdated
.nav__list { | ||
display: flex; | ||
width: 1200px; | ||
justify-content: flex-end; | ||
list-style: none; | ||
padding: 0; | ||
margin-left: 50px; | ||
} |
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.
.nav__list { | |
display: flex; | |
width: 1200px; | |
justify-content: flex-end; | |
list-style: none; | |
padding: 0; | |
margin-left: 50px; | |
} | |
.nav__list { | |
display: flex; | |
list-style: none; | |
padding: 0; | |
} |
} | ||
|
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.
} | |
} | |
body { | |
margin: 0; | |
} |
src/style.css
Outdated
.nav__link { | ||
color: #000; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
font-size: 12px; | ||
line-height: 14px; | ||
padding: 5px; | ||
position: relative; | ||
} |
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.
.nav__link { | |
color: #000; | |
text-decoration: none; | |
text-transform: uppercase; | |
font-size: 12px; | |
line-height: 14px; | |
padding: 5px; | |
position: relative; | |
} | |
.nav__link { | |
color: #000; | |
text-decoration: none; | |
text-transform: uppercase; | |
font-size: 12px; | |
line-height: 60px; | |
display: inline-block: | |
height: 60px; | |
} |
src/style.css
Outdated
} | ||
|
||
.nav__link:hover { | ||
color: #00acdc; |
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.
Create a variable for repeated color
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.
src/index.html
Outdated
<a href="index.html" | ||
class="logo" > |
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.
<a href="index.html" | |
class="logo" > | |
<a | |
href="index.html" | |
class="logo" | |
> |
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.
pls, don't hesitate to ask for some help with tests in the chat
because you need to pass it
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.
src/style.css
Outdated
body { | ||
margin: 0; | ||
padding: 0; |
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 body hasn't a padding
padding: 0; |
src/style.css
Outdated
.nav__link.is-active { | ||
display: inline-block; | ||
position: relative; | ||
border-color: #00acdc; |
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.
Use a variable for this color
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.
GJ! 👍
padding-left: 50px; | ||
padding-right: 50px; | ||
padding-top: 0; |
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.
padding-left: 50px; | |
padding-right: 50px; | |
padding-top: 0; | |
padding: 0 50px; |
color: var(--hover-color); | ||
} | ||
|
||
.nav__link.is-active::after { |
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.
.nav__link.is-active::after { | |
.is-active::after { |
padding-top: 0; | ||
box-sizing: border-box; | ||
margin: 0; | ||
height: 60px; |
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.
Redundant
height: 60px; |
padding-right: 50px; | ||
padding-top: 0; | ||
box-sizing: border-box; | ||
margin: 0; |
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.
margin: 0; |