This is a solution to the Blog preview card challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- See hover and focus states for all interactive elements on the page
- Solution URL: https://www.frontendmentor.io/solutions/single-price-grid-component-html-sass-grid-and-vite-bPAyz8cJe
- Live Site URL: https://fem2407-blog-preview-card-next.vercel.app/
- Mobile-first workflow
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- React - JS library
- Next.js - React framework
- Tailwind CSS - For styles
I learned how to apply styling based on the parent state using the Tailwind CSS 'group' modifier.
Here's an example:
<div className="group" id="my-card">
<h2>Big Title</h2>
<p>lorem ipsum something something...</p>
<button className="group-hover:bg-green-600">click me</button>
</div>
When hovering the mouse over ANY part of the card, the background color of the inner button element will turn green.
I may use an API to render multiple cards in a grid.
- Tailwind CSS - This helped me learn about the 'group' modifier.
- Frontend Mentor - @DarrickFauvel
- LinkedIn - Darrick Fauvel