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

Responsive QR Code Component Solution Using CSS Flexbox Layout Module

@kanishkasubash

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


Hi! 👋, Frontend Friends.

I've just completed my first front-end coding challenge. This is my solution for the QR Code Component.

🛠️ Built With:

  • Semantic HTML5 markup
  • SASS/SCSS
  • Node.JS
  • GULP.JS
  • Mobile First Approach

📦Features:

  • Responsiveness (Mobile/Tab/Laptop/Desktop).

🔖What I am learned:

  • Level Up SCSS
  • CSS Flexbox & Grid. Link

❓Questions for the community:

  • I have a question about best practices. Is the Flexbox best layout module to design flexible responsive layout structure?

💡Any suggestions on how I can improve are welcome!

😊I'll be happy to hear any feedback and advice! Thank you.

Community feedback

@asbhogal

Posted

Hi Kanishka,

Great work! In answer to your question, flexbox is generally the best modern layout method to use for flexible responsive structures. Grid would be used for content where you want better control of their layout using columns and rows. This article explains it quite well Link as well as this video by Kevin Powell which demonstrates in practice when you would use which Link (NB. You can also combine them in an application, it all depends on the use-case)

Also I've had a look at your code and semantically you could change this to just have the child elements as div and img inside the main tag, you don't necessarily need the article as this serves a different purpose Link

Another thing - make sure to always locally host your fonts for privacy and performance reasons. Here's another good video which shows how to practically do this Link You can also download your typeface using Fontsource npm packages, then import the weights you require and reference them in your elements. Super easy and convenient Link

Hope this helps!

Marked as helpful

0

@kanishkasubash

Posted

Hi Aman,

Seems very helpful, will definitely check it out. Thanks a lot.

0

@kanishkasubash

Posted

When I consider self-hosting fonts, I made some changes to my source code bellow.

$fonts: (
  "OutfitRegular": "../assets/fonts/Outfit-Regular",
  "OutfitBold": "../assets/fonts/Outfit-Bold" 
);

@mixin font($font-family, $font-file, $font-weight) {
    @font-face {
        font-family: $font-family;
        font-weight: $font-weight;
        font-style: normal;        
        src: url(map-get($fonts, $font-file) + '.woff') format('woff'),
                url(map-get($fonts, $font-file) + '.woff2') format('woff2');
    }
}

@include font('Outfit', OutfitRegular, 400);
@include font('Outfit', OutfitBold, 700);

:root {
    --font-outfit: 'Outfit', sans-serif;
}

p {
    font-family: var(--font-outfit);
    font-size: 1rem;
    font-weight: 400;
}
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