-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 #5318
base: master
Are you sure you want to change the base?
Add task solution #5318
Conversation
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.
Thank you for your hard work on this project! 😊 While your code is mostly on the right track, there are a few critical issues that need to be addressed before we can proceed. The logical error in the nth-child
selectors is significant because it affects the functionality of displaying active stars correctly. Additionally, the class naming and file structure do not fully comply with the task requirements, which could lead to maintenance challenges in the future. Please make these adjustments, and you'll be all set! Keep up the great work! 🌟
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
src/style.css
Outdated
.stars--0 .stars_star:nth-child(-n + 0), | ||
.stars--1 .stars_star:nth-child(-n + 1), | ||
.stars--2 .stars_star:nth-child(-n + 2), | ||
.stars--3 .stars_star:nth-child(-n + 3), | ||
.stars--4 .stars_star:nth-child(-n + 4), | ||
.stars--5 .stars_star:nth-child(-n + 5) { |
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 a logical error in the nth-child selectors. The selectors are intended to apply the active star image to a certain number of stars, but the range specified by nth-child(-n + 0) will not select any elements. You should adjust the selectors to correctly apply the active image to the intended number of stars. For example, for '.stars--0', you might want to use '.stars--0 .stars_star:nth-child(-n + 1)' to select the first star, and so on for the other classes.
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 effort on implementing the star rating system! 🌟 While the Pull Request is approved to help you progress in your learning journey, there are a few critical issues that need attention:
-
Class Naming: The current class names like
stars--0
,stars--1
are not descriptive enough. Consider using more meaningful names such asstars--active
orstars--inactive
to enhance readability and maintainability. -
Active Stars Logic: The
nth-child
selectors are not correctly highlighting the active stars. Ensure that the selectors match the intended number of active stars based on the zero-based index used in your HTML. -
File Structure: Each BEM block should have its own separate file. This is essential for maintaining a clean and organized codebase.
Please review the comments and make the necessary improvements. Addressing these issues will not only meet the task requirements but also enhance the overall quality of your code. Keep up the good work and continue learning from these experiences! 💪
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<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> | ||
</div> | ||
|
||
<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> | ||
</div> | ||
|
||
<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> | ||
</div> | ||
|
||
<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> | ||
</div> | ||
|
||
<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> | ||
</div> | ||
|
||
<div class="stars stars--5"> | ||
<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> | ||
</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.
The class names stars--0
, stars--1
, etc., are not descriptive. Consider using class names that better reflect the purpose or state of these elements, such as stars--active
or stars--inactive
, to improve readability and maintainability.
.stars--1 .stars_star:nth-child(-n + 1), | ||
.stars--2 .stars_star:nth-child(-n + 2), | ||
.stars--3 .stars_star:nth-child(-n + 3), | ||
.stars--4 .stars_star:nth-child(-n + 4), | ||
.stars--5 .stars_star:nth-child(-n + 5) { |
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 nth-child
selectors are not correctly highlighting the active stars. Since the HTML uses zero-based indexing for the classes (e.g., stars--0
), the selectors should be adjusted to match the correct number of active stars. For example, .stars--1
should highlight the first star, .stars--2
should highlight the first two stars, and so on.
DEMO LINK
TEST REPORT LINK
Yellow stars are added with container modifier + pseudo-selector (NO extra classes)
Each BEM block has its own separate file
All
Typical Mistakes
fromBEM
lesson theory are checked.Code follows all the Code Style Rules ❗️