-
Notifications
You must be signed in to change notification settings - Fork 4.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 #4954
base: master
Are you sure you want to change the base?
develop #4954
Conversation
Daniil-102
commented
Oct 15, 2024
- DEMO LINK
- TEST REPORT 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.
Great job so far! 👍 However, there are a few areas that need improvement. Pay attention to your CSS code, avoid setting fixed width and height if not necessary, and be consistent with your margins. Also, avoid using the *
selector as it impacts performance. In your HTML, ensure proper formatting of attributes and correct indentation for readability. Keep up the good work and make these changes for better code quality. 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -13,6 +13,52 @@ | |||
/> | |||
</head> | |||
<body> | |||
<h1>Stars</h1> | |||
<div class="stars stars--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.
Remember about correct indentation between parent and child elements. Each level of nesting, including text, contained inside the element, requires 2-space offset. For instance, in line 16, the 'div' elements inside the 'stars' class should be indented with 2 spaces.
src/style.css
Outdated
html { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} |
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 the *
selector as it impacts performance. Set styles only for elements that require them. Zeroing out your margins, paddings, or other styles with '*' is still inefficient for the browser.
src/style.css
Outdated
.stars { | ||
display: flex; | ||
margin-bottom: 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.
To avoid potential margin collapse, be consistent with your margins. Add only top or bottom, but not both. In this case, you have a margin-bottom: 0;
which might not be necessary.
.stars__star { | ||
width: 16px; | ||
height: 16px; | ||
background-image: url('images/star.svg'); | ||
background-size: auto; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
margin-right: 4px; | ||
} |
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 container size if there is no such requirement. Let the content size dictate it. To avoid overflow or accidental scroll bar, it would be better not to set a fixed width and height for .stars__star
.
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 job on your project! Your HTML and CSS files are well-structured and clean. There are a few formatting issues and places where the code could be improved, so make sure to review the comments. Keep practicing and continue to improve your coding skills. Happy coding! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -12,7 +12,54 @@ | |||
href="./style.css" | |||
/> |
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.
According to the checklist, if the HTML-element has long attribute values or number of attributes is more than 2, you should start each one, including the first, on the new line with 2-space indentation related to tag. Tag’s closing bracket should be on the same level as opening one. Please adjust the formatting accordingly.
<div class="stars stars--0"> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> |
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 should add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. But don't add them between parent and child elements. Add an empty line after this block.
<div class="stars stars--1"> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> |
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 an empty line after this block.
<div class="stars stars--2"> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> |
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 an empty line after this block.
<div class="stars stars--3"> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> |
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 an empty line after this block.
<div class="stars stars--4"> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> |
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 an empty line after this block.
@@ -1 +1,47 @@ | |||
/* add styles here */ | |||
body { |
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 use tag names for styling (except html
and body
). This can lead to unexpected results when your project grows and becomes more complex. I would suggest to add a class to the body
tag and style it instead. Refer to the checklist item: 'Don't use tag names for styling (except html
and body
)'
.stars--0 .stars__star:nth-child(-n + 0) { | ||
background-image: url('images/star-active.svg'); | ||
} | ||
|
||
.stars--1 .stars__star:nth-child(-n + 1) { | ||
background-image: url('images/star-active.svg'); | ||
} | ||
|
||
.stars--2 .stars__star:nth-child(-n + 2) { | ||
background-image: url('images/star-active.svg'); | ||
} | ||
|
||
.stars--3 .stars__star:nth-child(-n + 3) { | ||
background-image: url('images/star-active.svg'); | ||
} | ||
|
||
.stars--4 .stars__star:nth-child(-n + 4) { | ||
background-image: url('images/star-active.svg'); | ||
} | ||
|
||
.stars--5 .stars__star:nth-child(-n + 5) { | ||
background-image: url('images/star-active.svg'); | ||
} |
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.
There is some code duplication here. You are setting the same background image for each condition. A better approach would be to set the background-image
property once for all .stars__star
elements and then just change it when needed. This will make your code DRYer and easier to maintain.