-
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
add task solution #3412
base: master
Are you sure you want to change the base?
add task solution #3412
Conversation
NataliaDavida
commented
Jul 29, 2023
•
edited
Loading
edited
- 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.
add demo link and test report link to the description of a pr
src/style.css
Outdated
|
||
.stars { | ||
display: flex; | ||
width: 96px; |
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.
3'rd point in checklist
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.
isn't fixed. No needs to hardcode width
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.
Hello!)
Also, please check this comment since it wasn't fixed
#3412 (comment)
If you need any help feel free to ask at fe_chat
src/style.css
Outdated
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
color: #e5e5e5; |
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.
redundant
color: #e5e5e5; |
src/style.css
Outdated
background-image: url("./images/star.svg"); | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; |
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.
apply background shorthand
src/style.css
Outdated
.stars__star:not(:last-child) { | ||
margin-right: 4px; | ||
} | ||
|
||
.stars--5 .stars__star { | ||
background-image: url("./images/star-active.svg"); | ||
} | ||
|
||
.stars--1 .stars__star:nth-child(1) { | ||
background-image: url("./images/star-active.svg"); | ||
} | ||
|
||
.stars--2 .stars__star:nth-child(1), | ||
.stars--2 .stars__star:nth-child(2) { | ||
background-image: url("./images/star-active.svg"); | ||
} | ||
|
||
.stars--3 .stars__star:nth-child(1), | ||
.stars--3 .stars__star:nth-child(2), | ||
.stars--3 .stars__star:nth-child(3) { | ||
background-image: url("./images/star-active.svg"); | ||
} | ||
|
||
.stars--4 .stars__star:nth-child(1), | ||
.stars--4 .stars__star:nth-child(2), | ||
.stars--4 .stars__star:nth-child(3), | ||
.stars--4 .stars__star:nth-child(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.
this type of adding styles isn't flexible. Imagine if you have a case with 10 stars or even more?
- use
:nth-child(-n + {{here_will_be_a_number_from_1_to_5}})
Example:
.my__star:nth-child(-n + 4)
- if your selectors have the same style use them as a group
Example:
.my__selector1,
.my__selector2 {
color: #ff0000;
}
src/style.css
Outdated
|
||
.stars { | ||
display: flex; | ||
width: 96px; |
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.
isn't fixed. No needs to hardcode width
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!!! Left just one moment
src/style.css
Outdated
.stars--5 .stars__star { | ||
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.
Move it down as other selectors for modifiers
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.
good job