Cards Component
Responsive Dark Mode Card Component for Portfolio with Pastel color scheme.
HTML Code
<!-- ./ src/components/Card.astro -->
<div class="max-w-sm mx-auto rounded-md overflow-hidden shadow-lg bg-white dark:bg-gray-800 m-4">
<img class="w-full" src="https://picsum.photos/400/250" alt="Placeholder image">
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2 text-gray-800 dark:text-white">Card Title</div>
<p class="text-gray-700 dark:text-gray-300 text-base">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<div class="px-6 pt-4 pb-2">
<span class="inline-block bg-pastel-pink rounded-full px-3 py-1 text-sm font-semibold text-gray-700 dark:text-gray-800 mr-2 mb-2">#tag1</span>
<span class="inline-block bg-pastel-green rounded-full px-3 py-1 text-sm font-semibold text-gray-700 dark:text-gray-800 mr-2 mb-2">#tag2</span>
<span class="inline-block bg-pastel-blue rounded-full px-3 py-1 text-sm font-semibold text-gray-700 dark:text-gray-800 mb-2">#tag3</span>
</div>
<div class="flex items-center px-6 py-4">
<img class="w-10 h-10 rounded-full mr-4" src="https://randomuser.me/api/portraits/men/1.jpg" alt="Avatar of user">
<div class="text-sm">
<p class="text-gray-900 dark:text-white leading-none">John Doe</p>
<p class="text-gray-600 dark:text-gray-400">Aug 18, 2023</p>
</div>
</div>
</div>
<style>
.bg-pastel-pink {
background-color: #f9cdda;
}
.bg-pastel-green {
background-color: #b2f2bb;
}
.bg-pastel-blue {
background-color: #a7ccff;
}
</style>
Related Components
Skeuomorphic Cards Component
Inspired by Skeuomorphism, the following card component is fully responsive with dark theme support. For dark mode, CSS support is sufficient. No JavaScript is needed.
Cards Component
A complex cards component designed for dark mode, suitable for blog and content consumption with a triadic color scheme.