Design comparison
SolutionDesign
Community feedback
- @leanhduyPosted 7 months ago
Good work!
Through my review of your code, I have one following suggestion:
-
Consider creating variables to hold shared values in the css (e.g., colors), instead of hardcoding in each element
color
orbackground-color
- Create variables in the
html
selector: e.g.,--text-main: #ff0000;
- Use the variable. e.g.,
h1 { color: var(--text-main); }
Why: Better code maintability. If there is a requirement change about the color, you will only need to update the value of variable in the
html
selector, instead of finding all elements with same color and update it. - Create variables in the
Marked as helpful1 -
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