-
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
solution #4856
base: master
Are you sure you want to change the base?
solution #4856
Conversation
skrudj98
commented
Sep 24, 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.
Everything looks great! Your CSS for the .stars
class is minimal and correct, and your CSS imports are well-organized. Keep up the good work with maintaining a clean structure for your styles! 🌟👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -9,10 +9,51 @@ | |||
<title>Stars</title> | |||
<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.
Attributes of the link
tag should start each on a new line with 2-space indentation related to the tag to keep the attributes correctly formatted.
<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.
Add an empty line between sibling blocks of HTML to simplify reading, but don't add them between parent and child elements.
<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 between sibling blocks of HTML to simplify reading, but don't add them between parent and child elements.
<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 between sibling blocks of HTML to simplify reading, but don't add them between parent and child elements.
<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 between sibling blocks of HTML to simplify reading, but don't add them between parent and child elements.
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
margin-left: 22px; |
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 first star has a different margin-left
value compared to the others. Ensure this is intentional. If all stars are supposed to be evenly spaced, this value should be consistent with the margin-left of other stars.
@@ -0,0 +1,44 @@ | |||
.stars--4 { | |||
display: flex; | |||
margin-top: 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.
Be consistent with your margins. It's recommended to add only top or bottom margins, but not both, to avoid potential margin collapse issues.
display: block; | ||
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; |
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 using a class for common styles to avoid repetition. Each .stars__star
has the same display
, background-image
, width
, and height
properties. You can extract these to a single class to make your CSS more maintainable.
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
margin-left: 22px; |
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 margin-left
for the first star creates an inconsistency with the rest of the stars. According to the checklist, be consistent with your margins. If there's no specific requirement for the first star to have a different margin, it should be the same as the others.
.stars--5 .stars__star:nth-child(1) { | ||
display: block; | ||
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
margin-left: 22px; | ||
} | ||
|
||
.stars--5 .stars__star:nth-child(2) { | ||
display: block; | ||
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
margin-left: 4px; | ||
} | ||
|
||
.stars--5 .stars__star:nth-child(3) { | ||
display: block; | ||
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
margin-left: 4px; | ||
} | ||
|
||
.stars--5 .stars__star:nth-child(4) { | ||
display: block; | ||
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
margin-left: 4px; | ||
} | ||
|
||
.stars--5 .stars__star:nth-child(5) { | ||
display: block; | ||
background-image: url(../../images/star-active.svg); | ||
width: 13px; | ||
height: 12.2px; | ||
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.
To improve the maintainability of the code, consider using a single CSS rule for the .stars__star
elements that share the same styles. You can then override the margin-left
for the first child if it needs to be different.