Responsive Preview Stats Preview Card Component (CSS Grid / Flexbox)
Design comparison
Solution retrospective
I would be grateful for any feedback!
Community feedback
- @Chermann-KINGPosted over 1 year ago
👋Hi @Slaks97
I think you've already done a great job👌 in terms of accessibility.
Here are a few suggestions for improving your code:
- HTML:
Caching of external resources, such as Google Fonts, could be improved. You can add
rel="preload"
attributes to preload these resources and improve performance.- CSS:
1. Use CSS variables: CSS variables let you define reusable values for text styles, such as font size or color. By using variables, you can guarantee style consistency and facilitate subsequent modifications.
2. Units: Instead of using a fixed font size in pixels (
px
) as in thebody
, you can use a relative font size inem
orrem
. Use relative units of measurement (em, rem) for font size to create flexible and adaptable text styles, simplifying global adjustments of text size in your project.3. Use reusable classes for text styles: If you have similar text styles that are repeated in several elements, you can create reusable classes. This avoids repeating the same styles in different CSS selectors, simplifying code and facilitating subsequent updates.
4. Use more targeted selectors: In some cases, you can use more specific CSS selectors to apply specific styles to certain text elements. This saves you having to add additional classes to your HTML elements. You can use selectors based on the structure of your HTML to precisely target the desired elements.
The aim of these suggestions is to improve the maintainability, consistency and reusability of text styles in your CSS code. By following these best practices, you can make your code cleaner, easier to understand and easier to maintain. This is very useful when working on projects that are likely to evolve, for example.
Apart from these few tips, your code looks well structured and functional.
Good code😉
Marked as helpful0@Slaks97Posted over 1 year agoThank you so much for the thorough feedback @Chermann-KING, most helpful...and most grateful!
0
Please log in to post a comment
Log in with GitHubJoin 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