-
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 solution #4879
base: master
Are you sure you want to change the base?
add solution #4879
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! 🌟 Just a few minor points to keep in mind for future projects: be mindful of consistent margin usage, maintain proper indentation, and ensure clean structuring with empty lines between sibling blocks. These small details will enhance the readability and maintainability of your code. Keep up the good work!
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -13,6 +13,51 @@ | |||
/> | |||
</head> | |||
<body> | |||
<h1>Stars</h1> | |||
<div class="display"> |
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 2 spaces for indentation in your file. The div
element on line 16 should be indented with 2 spaces as it is a child of the body
element.
@@ -13,6 +13,51 @@ | |||
/> | |||
</head> | |||
<body> | |||
<h1>Stars</h1> | |||
<div class="display"> | |||
<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.
Remember about correct indentation between parent and child elements. The div
element on line 17 should be indented with 2 spaces as it is a child of the div
element on line 16.
<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 empty lines between multiline sibling blocks of HTML. There should be an empty line before line 18 and after line 24 to separate the sibling div
blocks.
<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> |
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. There should be an empty line before line 25 and after line 31 to separate the sibling div
blocks.
<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> |
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. There should be an empty line before line 32 and after line 38 to separate the sibling div
blocks.
<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> |
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. There should be an empty line before line 46 and after line 52 to separate the sibling div
blocks.
<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. There should be an empty line before line 53 and after line 59 to separate the sibling div
blocks.
|
||
.display { | ||
display: flex; | ||
margin: 0 auto; |
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 (Add only top or bottom, but not both). Here you have a margin set to '0 auto', which is fine for horizontally centering, but make sure you're not adding unnecessary vertical margins elsewhere that could lead to margin collapse.
margin: 2px; | ||
margin-right: 6px; |
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 setting margins on all sides of an element. It's better to choose either top or bottom for vertical spacing to prevent margin collapse issues. Since you have a right margin defined on line 28, you might want to remove the general margin on line 27, or make sure it's intentional and won't cause any layout issues.
|
||
.stars--5 :nth-child(-n + 5) { | ||
background-image: url(images/star-active.svg); | ||
margin-bottom: 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.
You have set 'margin-bottom: 0' on the last .stars--5
child, which is good for overriding the default margin set on .stars__star
. However, ensure that this is the only place where vertical margins are being manipulated to maintain consistency.
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 moving the margin bottom to the :last-child
selector
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 work! Almost done!
margin-right: 6px; | ||
} | ||
|
||
.stars--1 :nth-child(1) { |
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.
.stars--1 :nth-child(1) { | |
.stars--1 :nth-child(1), | |
.stars--2 :nth-child(-n + 2), | |
... { |
Consider using commas to group selectors
.stars--2 :nth-child(-n + 2) { | ||
background-image: url(images/star-active.svg); | ||
} | ||
|
||
.stars--3 :nth-child(-n + 3) { | ||
background-image: url(images/star-active.svg); | ||
} | ||
|
||
.stars--4 :nth-child(-n + 4) { | ||
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.
.stars--2 :nth-child(-n + 2) { | |
background-image: url(images/star-active.svg); | |
} | |
.stars--3 :nth-child(-n + 3) { | |
background-image: url(images/star-active.svg); | |
} | |
.stars--4 :nth-child(-n + 4) { | |
background-image: url(images/star-active.svg); | |
} |
|
||
.stars--5 :nth-child(-n + 5) { | ||
background-image: url(images/star-active.svg); | ||
margin-bottom: 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.
Consider moving the margin bottom to the :last-child
selector
background-image: url(images/star.svg); | ||
background-size: cover; | ||
margin: 2px; | ||
margin-right: 6px; |
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 overriding margins in the same selectors
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 ❗️