64 lines
2.5 KiB
Markdown
64 lines
2.5 KiB
Markdown
# Frontend Mentor - Product preview card component solution
|
|
|
|
This is a solution to the [Product preview card component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/product-preview-card-component-GO7UmttRfa). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
|
|
|
|
## Table of contents
|
|
|
|
- [Frontend Mentor - Product preview card component solution](#frontend-mentor---product-preview-card-component-solution)
|
|
- [Table of contents](#table-of-contents)
|
|
- [Overview](#overview)
|
|
- [The challenge](#the-challenge)
|
|
- [Screenshot](#screenshot)
|
|
- [Links](#links)
|
|
- [My process](#my-process)
|
|
- [Built with](#built-with)
|
|
- [Author](#author)
|
|
- [Acknowledgments](#acknowledgments)
|
|
|
|
**Note: Delete this note and update the table of contents based on what sections you keep.**
|
|
|
|
## Overview
|
|
|
|
### The challenge
|
|
|
|
Users should be able to:
|
|
|
|
- View the optimal layout depending on their device's screen size
|
|
- See hover and focus states for interactive elements
|
|
|
|
### Screenshot
|
|
|
|
![Mobile](screenshots/mobile.png)
|
|
![Mobile Dark](screenshots/mobile-dark.png)
|
|
![Desktop](screenshots/desktop.png)
|
|
![Desktop Dark](screenshots/desktop-dark.png)
|
|
|
|
### Links
|
|
|
|
- Solution URL: [Github](https://github.com/tarasis/tarasis.github.io/tree/main/projects/FrontendMentor/newbie/product-preview-card-component)
|
|
- Live Site URL: [tarasis.github.io](http://tarasis.github.io/FrontendMentor/newbie/product-preview-card-component)
|
|
|
|
## My process
|
|
|
|
Standard for me so far. Set up CSS properties for most things.
|
|
Then I built the mobile version of the page.
|
|
Made minor changes for the desktop version.
|
|
Added a Light/Dark switcher, just to show updating the variables to change the colors.
|
|
|
|
### Built with
|
|
|
|
- Semantic HTML5 markup
|
|
- CSS custom properties
|
|
- Flexbox (for some alignment)
|
|
- CSS Grid (just for putting in the middle of the page)
|
|
- Mobile-first workflow
|
|
|
|
## Author
|
|
|
|
- Website - [Robert McGovern](https://tarasis.net)
|
|
- Frontend Mentor - [@tarasis](https://www.frontendmentor.io/profile/tarasis)
|
|
- Twitter - [@tarasis](https://www.twitter.com/tarasis)
|
|
|
|
## Acknowledgments
|
|
|
|
Two articles gave me the setup for the Light / Dark switcher I've set up. The first by [Musthaq Ahamad](https://medium.com/@haxzie/dark-and-light-theme-switcher-using-css-variables-and-pure-javascript-zocada-dd0059d72fa2) gave the JavaScript, but I didn't want to have it as a sliding button and with using a class for dark mode. For handling that I used ideas from [Luke Lowrey's](https://lukelowrey.com/css-variable-theme-switcher/) implementation, using data attributes. |