Design comparison
Solution retrospective
- First project using Sass after a few weeks learning it. I'm not sure if I made a good use of nesting and mixins
- I wanted the testimonials container to be fully responsive so it can have 1-3 columns, so I applied a little bit of JavaScript in order to transform the testimonials Y coordinates only when the grid has 3 columns
Anything that could help improve my scss or any code in general will be apreciated
Community feedback
- @MelvinAguilarPosted 11 months ago
Hello there 👋. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- For star icons used decoratively, like in this challenge, it's best to keep the alt attribute empty. This prevents screen readers from repetitively reading the same description, which can be bothersome for users with visual impairments. So, you can simplify the code by leaving the alt attributes for the star icons empty.
-
I feel that it's not necessary to use JavaScript to create a responsive web page. You could have utilized media queries to add and remove margins from components. If you choose not to use media queries due to how you've set up your
grid-template-columns
, you could assign a minimum height to the container. Then, align the vertical alignment of its items usingalign-self
.align-self
aligns the items within their grid layout vertically..testimonials { [...] min-height: 300px; display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); } .testimonial:nth-child(1) { /* You can use a custom class here*/ align-self: start; } .testimonial:nth-child(2) { align-self: center; } .testimonial:nth-child(3) { align-self: end; }
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
Marked as helpful1@Jorge-sanchez09Posted 11 months ago@MelvinAguilar Greetings 👋
-
I see, I hadn't thought about the images description, I didn't remember the meaning of leaving the alt attribute empty 😅.
-
Yeah, the
align-self
method would have been much nicer than using JavaScript 😞.
Thank you very much for the help! 😁
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