-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,47 @@ | ||||
body { | ||||
margin: 0; | ||||
} | ||||
|
||||
.stars { | ||||
display: flex; | ||||
width: 96px; | ||||
} | ||||
|
||||
.stars__star { | ||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. apply background |
||||
color: #e5e5e5; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant
Suggested change
|
||||
} | ||||
|
||||
.stars__star:not(:last-child) { | ||||
margin-right: 4px; | ||||
} | ||||
|
||||
.stars--5 .stars__star { | ||||
background-image: url("./images/star-active.svg"); | ||||
} | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move it down as other selectors for modifiers |
||||
|
||||
.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 commentThe 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?
|
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