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.
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
- Solution URL: https://www.frontendmentor.io/solutions/single-price-grid-component-html-sass-grid-and-vite-bPAyz8cJe
- Live Site URL: https://fem09-single-price-grid-component-drrck.netlify.app/
- Mobile-first workflow
- Semantic HTML5 markup
- CSS Grid
- Flexbox
- Sass - CSS with superpowers
- Vite - Superfast bundling tool
I learned to create a Sass function that converts px units to rem units. Here is the function I use for font sizing:
@use 'sass:math';
@function pxToRem($pxValue) {
@return math.div($pxValue, 16) * 1rem;
}
I would like to possibly redo this solution using Open Props sub-atomic styles.
- Sass: math.div function - This is the modern method of dividing two numbers
- Frontend Mentor - @DarrickFauvel
- LinkedIn - Darrick Fauvel