-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 #4896
base: master
Are you sure you want to change the base?
add task solution #4896
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.
Great job on your Pull Request! 👍 While there are some minor issues like code style and best practices, none of them critically impact the functionality or security of your code. Remember to keep your CSS DRY, add fallback font families, manage line lengths, and maintain consistent indentation for better readability in the future. Keep up the good work! 🚀
✨ 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> |
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 should be an empty line between sibling elements that are multiline blocks, but not between parent and child elements. Add an empty line after the closing tag of each 'stars' block to improve readability.
.stars { | ||
display: flex; | ||
} | ||
|
||
.stars__star { | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-image: url(images/star.svg); | ||
|
||
display: flex; | ||
} | ||
|
||
.stars__star + .stars__star { | ||
margin-left: 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.
Consider adding a fallback font-family for better cross-browser compatibility. Even though this block does not set the font-family
directly, it's a good practice to ensure that all text-containing elements have a fallback font specified.
.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) { | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-image: url(images/star-active.svg); | ||
|
||
display: flex; | ||
} |
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 .stars__star
class already defines the width
, height
, background-repeat
, background-position
, and display
properties. Redefining these properties for each .stars--X .stars__star:nth-child(-n + X)
selector is unnecessary and repetitive. Consider removing the duplicated properties to keep your CSS DRY (Don't Repeat Yourself).
Typical Mistakes
fromBEM
lesson theory are checked.