Design comparison
Solution retrospective
Feedbacks are always welcome!
Community feedback
- @kem522Posted about 3 years ago
Good work! The styling is really on point and I love the different color themes 😍
I see that you're using JavaScript to change the styling of each element but I think you could make it much easier for yourself by using CSS variables.
Here is an article on CSS variables: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties
And here is one about how to use a little bit of JS alongside CSS variables to switch between themes on your site: https://medium.com/@haxzie/dark-and-light-theme-switcher-using-css-variables-and-pure-javascript-zocada-dd0059d72fa2
In general anything that can be done in HTML or CSS instead of JS should be as the bigger the JS bundle then the slower your site will be. Also, in some cases people may have JS disabled and so you will lose that piece of functionality which might have been able to load otherwise. Finally, you want your JS files to be as simple as possible so they are easier to work on so the more things you can delegate elsewhere the better.
Hope those articles are helpful!
Marked as helpful0@ivancdaPosted about 3 years ago@kem522 Hi Katie! Thank you very much for the tips! 🥰
I implemented the variables in the css and it's amazing how much code I could erase from my JS file.
Those articles you sent were a great help for sure, and your insights about js, html and css really improved my perspective on frontend functionality in general.
Now I'm looking for the next project here on Frontend Mentor, if you have any ideas or more tips I'd love to hear them.
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