Skip to content

fmanimashaun/single-price-grid-component

Repository files navigation

Frontend Mentor - Single price grid component solution

This is a solution to the Single price grid component 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
  • See a hover state on desktop for the Sign Up call-to-action

Screenshot

  • Desktop

Desktop Image

  • Mobile

Mobile Image

Links

My process

Built with

  • Semantic HTML5 markup
  • Sass
  • Flexbox
  • Mobile-first workflow
  • TypeScript
  • Vite for development and build process
  • GitHub Pages for deployment

What I learned

In the styling part, I break the UI into manageable components and use as many utilities classes as possible to reduce the amount of custom styling. However, I purge the final css of all unused utility classes to ensure the final css is as small as possible.

// Generate font-weight utility classes with responsive variants
@each $weight, $value in $font-weights {
	.text-#{$weight} {
		font-weight: #{$value};
	}
}

// Generate font-style utility classes with responsive variants
@each $style, $value in $font-styles {
	.text-#{$style} {
		font-style: #{$value};
	}
}

// Generate text-align utility classes with responsive variants
@each $align, $value in $text-aligns {
	.text-#{$align} {
		text-align: #{$value};
	}
}

// Generate font-weight utility classes with responsive variants
@each $weight, $value in $font-weights {
	@each $breakpoint, $breakpoint-value in $breakpoints {
		@media screen and (min-width: #{$breakpoint-value}) {
			@at-root .#{$breakpoint}-text-#{$weight} {
				font-weight: #{$value};
			}
		}
	}
}

// Generate font-style utility classes with responsive variants
@each $style, $value in $font-styles {
	@each $breakpoint, $breakpoint-value in $breakpoints {
		@media screen and (min-width: #{$breakpoint-value}) {
			@at-root .#{$breakpoint}-text-#{$style} {
				font-style: #{$value};
			}
		}
	}
}

// Generate text-align utility classes with responsive variants
@each $align, $value in $text-aligns {
	@each $breakpoint, $breakpoint-value in $breakpoints {
		@media screen and (min-width: #{$breakpoint-value}) {
			@at-root .#{$breakpoint}-text-#{$align} {
				text-align: #{$value};
			}
		}
	}
}

Continued development

I plan to explore advanced SASS features to enhance the maintainability and scalability of my stylesheets. I also intend to further integrate TypeScript in future frontend projects to reinforce type safety and streamline debugging.

Useful resources

Author

👤 Engr. Animashaun Fisayo

Acknowledgments

This project was completed as part of the Frontend Mentor challenge. The platform provided an excellent opportunity to practice and refine my front-end skills through realistic project challenges.

About

This is a solution to the [Single price grid component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/single-price-grid-component-5ce41129d0ff452fec5abbbc). Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published