-
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 #4865
base: master
Are you sure you want to change the base?
add task solution #4865
Conversation
taniavozniuk
commented
Sep 26, 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.
Hey there! It looks like you're making great progress. 👍 However, I've noticed a few areas that could use some adjustments before we can approve your Pull Request. Here's what we need to address:
- Consistency in units for margins - let's stick to one unit,
px
is fine. - The
background-image
URL - we should extract this into a custom property for better manageability. - The
box-sizing
property - it's best to apply this globally to all elements for a consistent box model. - Unused custom properties - let's remove any code that isn't being used to keep things tidy.
- Semantic HTML - consider using more descriptive tags like
figure
andfigcaption
for the rating stars. - Code formatting - adding some empty lines and proper indentation will make your code easier to read and maintain.
Once these adjustments are made, your code will be in better shape! Keep up the good work and we'll be ready to approve in no time. 😄 Remember, these changes will help make your code more efficient and maintainable in the long run!
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<div class="stars-container"> | ||
<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.
Add empty lines between multiline sibling blocks of HTML to improve readability.
<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.
Use semantic tags where possible. For example, if these stars represent a rating, consider wrapping each group in a figure
tag with a figcaption
describing the rating.
src/style.css
Outdated
:root{ | ||
--main-images: (./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.
The --main-images
custom property is defined but never used. If it's intended for use, make sure to implement it where necessary. Otherwise, consider removing unused code to keep the stylesheet clean.
body { | ||
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.
The box-sizing: border-box;
should be applied globally to all elements for consistency. Move it to a universal selector *
at the top of your stylesheet.
body { | ||
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.
The body
selector is a tag name selector, which is discouraged by the checklist. However, for the body
tag, it is commonly accepted to use the tag itself for styling since it's the document's body element. Just ensure that this is the only tag selector used besides html
.
background-image: url(./images/star.svg); | ||
background-position: center; | ||
margin-right: 4px; | ||
background-repeat: no-repeat; |
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 background-image
URL should be extracted into a custom property since it's reused in multiple places. This will make it easier to manage and update the image path if needed.
height: 16px; | ||
background-image: url(./images/star.svg); | ||
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.
Consider using a consistent unit for margins. If you're using px
for widths and heights, you might want to use px
for margins as well for consistency, unless there's a specific reason for using 4px
here.
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 a few minor improvements suggested, like adding empty lines for better readability and adjusting the indentation for consistency, none of these issues are critical and don't impact the functionality or security of your code. Keep these tips in mind for future projects to make your code even better! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<div class="stars-container"> | ||
<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.
Add an empty line between sibling blocks of HTML to improve readability. For example, add an empty line after line 23.
<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 improve readability. For example, add an empty line after line 29.
</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> |
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 improve readability. For example, add an empty line after line 35.
<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> |
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 improve readability. For example, add an empty line after line 41.
<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> |
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 improve readability. For example, add an empty line after line 47.
<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> |
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 improve readability. For example, add an empty line after line 53.
.stars__star { | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(./images/star.svg); | ||
background-position: center; | ||
margin-right: 4px; | ||
background-repeat: no-repeat; | ||
} |
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. It's better to style elements using classes to ensure that the styles are more modular and avoid potential conflicts with other styles.
For example, instead of styling .stars__star
, if there are other star elements in your project that should not have these styles, consider using a more specific class name.
background-repeat: no-repeat; | ||
} | ||
|
||
.stars--0 .stars__star:nth-child(-n + 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 selector .stars--0 .stars__star:nth-child(-n + 0)
will never match any elements because nth-child(-n + 0)
selects no elements. You can remove this rule if it's not intended to apply any styles.