QR code component

Solution retrospective
I already had some experience in solving similar problems, so I decided to make the layout more adaptive, using Flexbox, and more improveable, using CSS variables.
In order not to worry about resetting built-in browser styles, I used Normalize.css.
What challenges did you encounter, and how did you overcome them?Unfortunately, I found out that the standard CSS does not have such functions as mixins, although they would be appropriate for adding text styles. See the example below.
@mixin text-preset-1 { font: 700 22px/120% "Outfit", sans-serif; letter-spacing: 0px; } @mixin text-preset-2 { font: 400 15px/140% "Outfit", sans-serif; letter-spacing: 0.2px; }
What specific areas of your project would you like help with?.card__title { @include text-preset-1; margin: 0; text-align: center; color: var(--slate-900); } .card__subtitle { @include text-preset-2; margin: 0; text-align: center; color: var(--slate-500); }
I'd be interested to know what fallback exists to reproduce mixin functionality in vanilla css.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@teempe
Nice job with this task. You may consider for future projects using semantic elements like for example
<article>
,<section>
etc. instead of<div>
making your markup more meaningful to both developers and assistive tech. Try using rem/em for your fonts and spacing instead of px so your layout adapts smoothly across screen sizes and respects user settings. Keep experimenting and refining, you’re doing fantastic work!Marked as helpful - @ThaissaLeslye
CSS custom properties, also known as CSS variables, are a powerful feature that allow developers to define reusable values directly in CSS. They improve code maintainability, consistency, and make it easier to apply global design changes.
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