Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 years ago

Compact QR Code Challenge

sass/scss, accessibility
Momin Riyadh•370
@momin-riyadh
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Great job on developing a QR code component in HTML5, CSS3, and JavaScript! Here are some questions for feedback:

  • What do you think of the overall functionality of the QR code component?
  • Are there any bugs or issues that need to be addressed?
  • How does the component handle different types of input data?
  • Is it able to generate QR codes for different types of data, such as URLs, plain text, and email addresses?
  • Are there any areas of the code that you think could be improved or optimized?
  • For example, is there any unnecessary duplication or inefficiency in the code?
  • Have you followed best practices for accessibility and user experience?
  • Is the component easy to use and navigate for all users, including those with disabilities?
  • Have you considered how the component will look and function on different devices and screen sizes?
  • Is it responsive and adaptable to different contexts?
  • Finally, have you tested the component thoroughly to ensure it works as expected in all scenarios?
  • Have you considered edge cases and unexpected inputs that might cause issues?
Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Stephen Yu•150
    @StephenYu2018
    Posted about 2 years ago

    I liked the sizing of the component, image and texts. I'd also like to give a few suggestions for what you can do in the future:

    • alt attribute of <img> represents alternative text that is displayed in place of the image when the browser cannot display that image for some reason/error. A better and more descriptive alt text for the <img> would be alt="QR code to visit Frontend Mentor"
    • Prefer using rem measurements instead of px measurements for sizing. rem calculates its measurement off the font size of the root element (which is html). The font size of the root element is dictated by the browser and can be changed by the user. While the default is 16px on most browsers, users can choose to make it larger, possibly because most text would be too small to read. By sticking with px measurements, you remove that capability from the user, as the text won't scale larger when the user chooses larger font sizes. Instead the text will remain the same size.
      • Also, do not style html font size using px to change how the root font size appears. That also removes that feature from the user as well. If you want the root font size of your page to appear at a different size:
        • Use percentage units %
        • Divide your apparent root font size with the actual default root font size
        • Example: If I wanted my root font size to appear at 13px instead of 16px, I would do the following calculation: 13px / 16px = 0.8125 = 81.25%
        • The final CSS property would be html { font-size: 81.25%; }
    Marked as helpful
  • visualdennis•8,375
    @visualdenniss
    Posted about 2 years ago

    Hello there,

    good work overall. Congrats.

    • height: auto; is kinda redundant as it is the default value. E.g. you gave height: auto; for the img.

    • Also avoid fixed heights like height: calc(100vh - 40px); better would be to use min-height approach.

    Hope you find this feedback helpful!

    Marked as helpful
  • Ecem Gokdogan•9,380
    @ecemgo
    Posted about 2 years ago

    Some recommendations regarding your code that could be of interest to you.

    In order to fix the accessibility issues:

    • You need to replace <div class="container"> with the <main> tag and <div class="attribution"> with the <footer> tag. You'd better use Semantic HTML, and you can also reach more information about it from Using Semantic HTML Tags Correctly.
    • Each main content needs to start with an h1 element. Your accessibility report states page should contain a level-one heading. So, you need to use a <h1> element in the <main> tag instead of using <h3>. You can replace your <h3>Improve your front-end skills by building projects</h3> element with the <h1>Improve your front-end skills by building projects</h1> element.

    Hope I am helpful. :)

    Marked as helpful

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub