
Design comparison
Solution retrospective
I'm proud that I manage to make it nearly like orginal.
What challenges did you encounter, and how did you overcome them?STYLING THESE LISTS!! I hate it so badly so I decided to set list style to none and style all by myself using ::before property.
What specific areas of your project would you like help with?I produced a lot of redundant code. I think it could have been done more simply
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Mirjax2000
Hi,
You did it exactly as i did. I mean that pseudoelements. Only one thing is missing and that is color. That before elements font has different color then text inside.
For that repeating your code.
declare one li: before{ here insert everything what has all li:before common - size,color,etc.., without content""; then make your nth elements only with what has to be change.
.instructions-row:nth-child(1)::before { and here insert what is changing, and that is content"1.")
.instructions-row::before{ font-size: 1rem; color:black; line-height: 1em; etc... .instructions-row:nth-child(1)::before {content:"1."}; .instructions-row:nth-child(2)::before {content:"2."}; .instructions-row:nth-child(3)::before {content:"3."}; .instructions-row:nth-child(4)::before {content:"4."};
or if you use Sass preprocesor you can write this short code - it is cycle.
@for $i from 1 through 6 { &:nth-child(#{$i}) { &::before { content:'#{$i}.' } } };
rest is perfect. I am also strugelling with code repeating. I have to practice more, and even before i start code some design i have to project some points where i will use same code.
Good job. thank you.
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord