Responsive Article Preview Component HTML / CSS / JS

Solution retrospective
I'm most proud of creating a component that works well across different screen sizes with distinct behaviors appropriate to each. The way the share functionality adapts between mobile and desktop demonstrates good responsive design thinking.
Next time, I would:
- Plan my HTML structure more carefully to avoid issues with overflow and positioning.
- Create a more modular CSS approach to handle the speech bubble styling.
- Consider using CSS custom properties for values like the mobile breakpoint to maintain consistency.
- Implement proper focus management from the beginning rather than adding it later.
-
Maintaining accessibility while toggling visibility - I initially struggled with properly updating aria-hidden attributes. I solved this by consistently checking the element's hidden state and setting the aria attribute accordingly.
-
Different behaviors across screen sizes - The mobile vs. desktop layout required different behaviors for the same components. I implemented conditional logic based on screen width to handle these differences.
-
Positioning issues with the toast component - I had challenges with the toast being cut off by overflow settings. I had to carefully balance maintaining border-radius on images while allowing the toast to be fully visible. Because I had
overflow: hidden
set on the article initially, the toast pop-up on larger devices was getting cut off. When I updated my stylesheet to haveoverflow: visible
at larger devices, my border-radius on the image disappeared. I solved that by manually adding the border-radius to both the top-left and bottom-left corners of the image. This allowed me to have the toast visible while maintaining the border-radius on the image. -
Focus management - The button staying in focus state after closing the toast was confusing. I learned to use the blur() method to programmatically remove focus when appropriate.
-
Creating a more elegant solution for the speech bubble styling that works well across all screen sizes
-
Improving my CSS Grid implementation to better handle complex layouts
-
Implementing smooth transitions/animations when toggling the visibility of elements
-
Developing a more comprehensive focus management system for better keyboard accessibility
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Kyle Mulqueen'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