Skip to content

seapagan-fem/pricing-component-with-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Pricing component with toggle solution

This is a solution to the Pricing component with toggle challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the component depending on their device's screen size
  • Control the toggle with both their mouse/trackpad and their keyboard
  • Bonus: Complete the challenge with just HTML and CSS

Screenshot

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow

What I learned

I tried to style the checkbox with minimal code and markup, basically just adding the class 'toggle' to a standard checkbox (no label or dummy elements needed) and have the minimal JS to make it work. It came out ok I think.

Continued development

I'll come back to this later and try to do it without JS. The spacing is a little off in places too and looks cramped with the bigger numbers.

Author