A deep dive into creating a fast, modern portfolio website using Astro framework and TailwindCSS
In todayβs competitive tech landscape, having a standout portfolio is crucial for developers. After exploring various frameworks, I chose Astro combined with TailwindCSS to build my personal portfolio. Hereβs why this combination is perfect for modern web development and how I implemented it.
Astro has quickly become my favorite framework for content-heavy websites. Hereβs what makes it special:
TIPIf youβre building a content-heavy website like a blog or portfolio, Astroβs performance benefits are immediately noticeable. The zero-JavaScript approach means lightning-fast load times!
IMPORTANTThe framework-agnostic approach means youβre not locked into any specific UI library. You can mix and match components from different frameworks in the same project!
src/
βββ components/ # Reusable UI components
β βββ includes/ # Header, footer, sidebar
β βββ project/ # Project-specific components
β βββ about/ # About page components
βββ data/ # MDX blog posts and project data
βββ layouts/ # Page layouts
βββ pages/ # File-based routing
βββ styles/ # Global styles and themes
βββ utils/ # Utility functions
NOTEThe following features showcase the power of combining Astro with modern web technologies to create a fast, accessible, and beautiful portfolio.
I implemented a custom theme system that goes beyond basic light/dark mode:
// Theme color picker with HSL color space
function setHue(hue) {
document.documentElement.style.setProperty("--theme-hue", hue.toString());
document.documentElement.style.setProperty("--theme-primary", `hsl(${hue}, 70%, 60%)`);
// ... more color variables
}Benefits:
Using MDX allows me to write rich, interactive blog posts:
// astro.config.mjs
remarkPlugins: [
remarkGfm, // GitHub Flavored Markdown
remarkBreaks, // Line break support
remarkEmoji, // Emoji support
remarkReadingTime // Reading time estimation
]Features:
rehype-pretty-codeTailwindCSS provides the perfect balance of utility and maintainability:
<div class="w-full flex flex-col lg:flex-row gap-8 items-start">
<aside class="w-full lg:w-80 lg:sticky lg:top-8">
<!-- Sidebar content -->
</aside>
<main class="flex-1 min-w-0">
<!-- Main content -->
</main>
</div>Key Benefits:
Astroβs built-in image optimization automatically:
<Image
src={projectImage}
alt="Project screenshot"
width={600}
height={400}
format="webp"
/>pnpm dev # Hot reload with instant updatesWriting blog posts is as simple as creating .mdx files:
---
title: "My Blog Post"
date: "2025-01-17"
tags: ["Web Development", "Astro"]
---
# My Blog Post
Content goes here...pnpm build # Generates optimized static filesclient:* directives| Technology | Version | Purpose |
|---|---|---|
| Astro | 4.x | Static site generator |
| TailwindCSS | 3.x | Utility-first CSS |
| TypeScript | 5.x | Type safety |
| MDX | 3.x | Rich content |
| Vite | 5.x | Build tool |
Building a portfolio with Astro and TailwindCSS has been an incredibly rewarding experience. The combination provides:
CAUTIONRemember that while Astro is excellent for content-heavy sites, it might not be the best choice for highly interactive applications. Choose your tools based on your specific needs!
Want to explore the code? Check out the source code for this portfolio:
TIPThe Astro repository is a great place to learn about modern web development practices and contribute to open source!
The modern web development landscape is constantly evolving, but with tools like Astro and TailwindCSS, we can build fast, maintainable, and beautiful websites that stand the test of time.
Building this portfolio with Astro and TailwindCSS has been an excellent learning experience. The combination provides:
The result is a fast, accessible, and visually appealing portfolio that showcases both technical skills and attention to user experience.
Try it yourself! The source code is available on my GitHub, and Iβd love to hear about your experience building with Astro.
Whatβs your experience with modern web frameworks? Have you tried Astro yet? Let me know your thoughts! π