Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Pricing component with toggle

Anthonyโ€ข 355

@ACdev27

Desktop design screenshot for the Pricing component with toggle coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Any feedback is appreciated.

I tried using BEM for the CSS here. Any suggestions for improvement for the BEM?

Also, any suggestions or tips regarding accessibility for the toggle switch?

Community feedback

P
ApplePieGiraffeโ€ข 30,565

@ApplePieGiraffe

Posted

Greetings, Anthony! ๐Ÿ‘‹

Good job on this challenge! ๐Ÿ‘ Your solution looks good, is responsive, and the toggle-switch works rather well! ๐Ÿ‘

It's nice that your toggle-switch is keyboard-accessible, but it might be worth using a few more semantic HTML tags from the start (rather than building the entire component out of div elements). For instance, you could perhaps use a button element or a checkbox to make the toggle-switchโ€”both of which are a little more inherently meaningful. Here's a great solution for this challenge from Grace that focuses on accessibility that you might be able to learn a thing or two from. ๐Ÿ˜‰

And small tip for the design of the solutionโ€”it might be worth allowing the container that holds the background color and images for the site to expand to fill up the entire area of the viewport. That way, there won't be any empty white space to the sides of the design on extra-large monitors.

Hope you find those one or two tips helpful. ๐Ÿ™‚

Keep coding (and happy coding, too)! ๐Ÿ˜

Marked as helpful

0
Anthonyโ€ข 355

@ACdev27

Posted

Thank you for your feedback. I agree with what you said that it would be good to use a semantic element like a button instead of making toggle from a div. And I had tried using a button, but had an issue. When you click on a button element, there is a movement of the element when you click it, and the way I created my toggle using pseudo class to add the circular part of toggle did not move along with rest of button, and it looked strange, so I had to switch back from button to div. I could not figure out how to disable the button's default animated effect when clicked on.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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