Design comparison
Solution retrospective
I really have a hard time making my css code dry so please any suggestions to help me with this issue. Please your feedback on my work generally to me is highly needed, thank you.
Community feedback
- @mattstuddertPosted over 4 years ago
Nice work on this challenge! I think you'd find it beneficial to use either
max-width
media queries ORmin-width
as opposed to both.I recommend using
min-width
and working mobile-first. It's quite a common workflow with front-end developers to use them and you might find it helpful. It can often lead to less CSS code and has the benefit of loading in fewer styles for mobile users, which can be a nice performance gain.I'd also recommend avoiding IDs as CSS selectors. They have high specificity and can't be reused on the page, so they're not good for the purpose of styling. Instead, I'd recommend sticking to class, attribute, pseudo, and type selectors. Using these will help keep your CSS more maintainable.
The key to writing DRY CSS code is finding repetitive blocks of code and creating reusable classes with meaningful names. You need to find recurring patterns in the design and it definitely helps to pre-plan it if possible before starting to code.
Let me know if you have any questions at all. Your solution looks really good. Keep up the great work! 🙂
1@MieibiPosted over 4 years agoHi, thank you very much for your comment. All pointers noted, thank you.
0
Please log in to post a comment
Log in with GitHubJoin 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