Design comparison
Solution retrospective
Hello there, I didn't use any frameworks to make this responsive QR code component, I'm curious if using one is needed for such a small project and would add any benefits, Also I would appreciate feedback on what good practices I need to apply in my current approach, Thanks for reading :)
Community feedback
- @correlucasPosted about 2 years ago
๐พHi Hamdi, congratulations on your solution!๐ Welcome to the Frontend Mentor Coding Community!
Great solution and a great start! From what I saw youโre on the right track. Iโve few suggestions for you that you can consider adding to your code:
- Use
<main>
instead of a simple<div>
this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a<main>
block and that<div>
doesn't have any semantic meaning. - Replace the
<h2>
containing the main title with<h1>
note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in the level of importance, never jump a level. - Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down. - I saw that you've used px and rem, but I think is better you use only rem to have your code with a standard. REM does not just apply to font size, but to all sizes as well.
Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
โ๏ธ I hope this helps you and happy coding!
Marked as helpful0@justgo97Posted about 2 years agoHi @correlucas Thanks for your feedback! I have pushed an update that covers all the points you mentioned, Though I'm not sure if I followed the last recommendation correctly, and If I should completely remove any occurrences of px like in margins and other places.
0@correlucasPosted about 2 years ago@justgo97 If you're using rem its better to use everywhere to make easier to work with your code.
To save your time you can code your whole page using
px
and then in the end use a VsCode plugin called px to rem here's the link โ https://marketplace.visualstudio.com/items?itemName=sainoba.px-to-rem to do the automatic conversion or use this website https://pixelsconverter.com/px-to-remMarked as helpful0@justgo97Posted about 2 years ago@correlucas Yes I'm using vscode, I didn't know such an extension exist, I will be using it from now on, Thanks a lot!
1 - Use
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