Mobile-first Responsive Pricing Component with Toggle
Design comparison
Solution retrospective
I thought this one was fun and useful. You see these pricing structure components everywhere.
My only real question is about the background image. Is there a better way to make this background image on small viewports grow appropriately and stay fixed in relation to the rest of the content?
Also, there seems to be a tiny little blip after the toggle slider moves to the monthly side. Any thoughts on why that is? Something to do with the transition I imagine.
Community feedback
- @rudyjm3Posted about 2 years ago
Hi rushinstuffin,
Your solution looks pretty good. The question you had on the "blip after the toggle slider moves to the monthly side" I'm guessing you are referring to how the price cards size changes slightly when going from one price point to the other. I took a look at your code and I would adjust the font size for the prices from 4.4rem down to 4rem. That way when the annual price is in view it will not cause its container to widen beyond what it is to accommodate for the larger price width.
For you 1st question about the background images, you may want to use percentages for placement instead. Instead of "background-position: top right, bottom left;" try "background-position: number%, number%, <== replaces top right;". I used this approach in the media query for the tablet view. I need to update the desktop media query with this method as well :)
Hope this helps, Take care.
Marked as helpful1
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