Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR code component with good ol' HTML and CSS

@joshjavier

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


This is a simple exercise in practicing the rule of least power, or not using a cannon to hunt a rabbit, so to speak. It is so easy to fall into the habit of using a framework for everything even when it's overkill for the task at hand. So for this solution, I used a single index.html file - no build step, no frameworks.

I did use CSS variables to make my component a little customizable. I've also thought about turning this into a web component, but ultimately felt it was unnecessary in this case.

In terms of accessibility, I decided to wrap the QR code image in a link, so if the image doesn't load (for users with slow internet) then they can still visit the link. Of course, this doesn't cover edge cases for when QR codes refer to actions other than visiting a link.

Community feedback

@Mr-Funderburk

Posted

Adding the link to the QR code was a great idea!

1

@joshjavier

Posted

@Mr-Funderburk thank you! ☺️

0

Please log in to post a comment

Log in with GitHub
Discord logo

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