Responsive QR Code Component

Solution retrospective
I’m most proud of how clean and responsive the final layout turned out. I started with a basic structure and was able to turn it into something visually polished by applying:
-Proper semantic HTML
-CSS Flexbox for alignment
-Mobile optimization with media queries
-Google Fonts integration to match the design's typography
Despite the project being small, I treated it as a professional component, paying attention to spacing and following a mobile-first approach, which made the project more scalable and better structured.
If I were to do this again, I would:
-Utilize a CSS preprocessor, such as SCSS, for improved style organization, even in small projects.
-Add accessibility features, such as ARIA labels and better contrast ratios for screen readers.
-Include unit tests (if building in a framework like React) to build good testing habits.
-Deploy earlier in the development process to catch layout bugs across devices sooner.
What challenges did you encounter, and how did you overcome them?One of the main challenges I faced was getting the layout to look consistent across different screen sizes. Initially, I used fixed width and height values for the card, which caused issues on smaller devices. The design was getting cut off or overflowing the screen.
To overcome this, I switched to a mobile-first approach and used more flexible units like max-width, min-height, and viewport-based units (vh, vw). I also added padding to the body to prevent edge clipping on very small screens.
Another challenge was matching the design spacing and typography from just a static JPG. Without exact Figma or Sketch files, I had to rely on visual judgment for things like font-size, line-height, and spacing. I used the browser’s developer tools to experiment with values until the layout felt balanced and clean.
What specific areas of your project would you like help with?I'm always looking to improve! Here are a few specific areas where I'd love some feedback:
-Responsiveness:
Does the layout behave well on all screen sizes, especially very small mobile devices? Are there better layout techniques I could have used?
-Typography & Spacing Judgment:
Since I didn’t use Figma/Sketch files, I had to eyeball spacing, font sizes, and line heights from a JPG. Are my visual approximations close to best practices?
-Code Structure & Readability:
Is my HTML and CSS organized clearly? Could I improve class naming, reduce repetition, or make it more scalable?
-Accessibility:
Are there simple accessibility improvements I missed (like better alt text, contrast, or keyboard navigation concerns)?
-Performance:
Are there any unnecessary styles or layout techniques that could be optimized for better rendering?
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on HARSHIKA BANSAL's solution.
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