Article preview component - HTML, CSS, JS

Solution retrospective
what approaches can be used to preserve active state while switching from mobile to desktop and vice-versa and update active state styles as per the viewport width?
I have implemented a basic solution, where i track button toggle state and then listen to resize
event on window object and update styles. But this is not very efficient solution.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Mahesh Yadav'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