-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 #4932
base: master
Are you sure you want to change the base?
Develop #4932
Conversation
k0tlik02
commented
Oct 14, 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.
You've done a great job so far! 👍 However, there are some minor issues with the semantics and formatting of your HTML code that need to be addressed. Don't worry, these are common areas everyone needs to improve on when they're learning. Keep up the good work! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
src/index.html
Outdated
<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 div
tags are not semantic. Consider using semantic tags where possible. For example, you might want to use section
tags to wrap each group of stars. Semantic tags like header
, section
, article
, p
improve your page SEO and help screen readers. div
and span
do not have any meaning.
src/index.html
Outdated
</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> |
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 multiline sibling blocks of HTML. This adds some 'air' and simplifies reading. But don't add them between parent and child elements.
body { | ||
margin: 0; | ||
padding: 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.
According to the checklist, you should avoid using tag names for styling (except html
and body
). In this case, you are styling the body
tag, which is acceptable. However, be mindful not to use other tag names for styling in the future.
.stars { | ||
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
class is used correctly here. It is a good practice to name your classes according to their function or the content they represent, as you have done here.
.stars__star { | ||
width: 16px; | ||
height: 16px; | ||
|
||
background: url(images/star.svg) no-repeat 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.
The .stars__star
class is also used correctly. You have followed the BEM naming convention, which is a good practice for writing maintainable and scalable CSS. However, remember to avoid fixing container size unless it is necessary for the design. In this case, you have set a fixed width and height for the .stars__star
class. Ensure that this is required for your design.
.stars--1 .stars__star:nth-child(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) { | ||
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.
You have used the nth-child
pseudo-class correctly to style individual stars based on their order. This is a good use of CSS selectors to achieve the desired effect without adding extra classes or ids in your HTML.
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 code! It's well structured and properly formatted. Just a small note for the future - try to avoid using tag names for styling (except html
and body
). It's a good practice to add a specific class to the element and style it. Keep up the good work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
body { | ||
margin: 0; | ||
padding: 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.
According to the checklist, you should not use tag names for styling (except html
and body
). It's better to add a specific class to the body and style it.