Skip to content

graficdoctor/fe-24-002-pricing-component-with-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 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

Links

My process

Built with

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

What I learned

  • Centering grid items in an auto-fill container - Something I've been bumping into regularly when using auto-fit for grid, is the grid no longer being centered. I usuasllu would look for work-arounds, but thought today that that was a silly solution and I should have a look at Stackoverflow. The solution is too straight-forward actually: justify-content: center.
.cards-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16.5rem, 20rem));
	justify-content: center;
	gap: 2rem;
	margin-inline: auto;
	margin-top: 4rem;
}

Useful resources

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published