This is a solution to the Product Preview Card Component challenge on Frontend Mentor. Frontend Mentor challenges help developers improve their coding skills by building realistic projects.
Users should be able to:
- View an optimized layout based on their device's screen size.
- See hover and focus states for all interactive elements.
- Live Site URL: Live Demo
To view and run this project locally, follow the steps below:
Make sure you have the following installed on your system:
- Node.js and npm (for SCSS compilation, optional if you're modifying the styles)
- A code editor like VS Code.
- A browser to view the project.
-
Clone the Repository:
git clone https://github.com/Yashi-Singh-9/Product-Preview-Card-Component.git
-
Navigate into the Project Directory:
cd Product-Preview-Card-Component
-
Install Dependencies (Optional for SCSS Compilation):
If you need to modify or recompile SCSS, install the required dependencies. Run:
npm install
Ensure you have
node-sass
installed globally or locally to compile SCSS to CSS. -
Compile SCSS (Optional):
If you make changes to the SCSS file, run:
npm run scss
This will compile the
styles.scss
file intostyles.css
. -
Run the Project:
Open the
index.html
file in your browser directly or use a live server extension in VS Code:npx live-server
- Semantic HTML5
- SCSS for styling
- Bootstrap 5 for layout and responsive design
- CSS Flexbox for alignment
- Mobile-first workflow
- Google Fonts:
- Montserrat for headings and buttons
- Fraunces for product name and price
Working on this project helped solidify my understanding of:
-
Responsive Design:
- Leveraging Bootstrap's grid system and utility classes for responsiveness.
- Using the
picture
element to serve different images for desktop and mobile views.
-
SCSS:
- Organized styling using variables for colors, reusable components, and media queries.
- Efficient handling of hover effects and transitions.
-
Accessibility:
- Adding meaningful alt text to images and aria-labels to interactive elements for better accessibility.
In future projects, I aim to focus on:
- Mastering CSS Grid and advanced SCSS techniques.
- Incorporating JavaScript for interactivity (e.g., animations, user feedback).
- Exploring more advanced Bootstrap 5 components for faster development.
- MDN Web Docs - Comprehensive resource for HTML, CSS, and JavaScript.
- CSS-Tricks Guide to Flexbox - Helpful for building responsive layouts.
- Bootstrap Documentation - Bootstrap components and utilities.
- Frontend Mentor: @Yashi-Singh-9
- LinkedIn: @Yashi-Singh
Special thanks to Frontend Mentor for providing engaging and meaningful challenges. Also, thanks to the developer community for their helpful resources and inspiration!