High-Performance Portfolio Website: Astro & UnoCSS

MK
Web Development
completed
FEATURED

High-Performance Portfolio Website: Astro & UnoCSS

A modern, lightning-fast portfolio website built with Astro and UnoCSS, achieving 95+ Lighthouse scores through systematic performance optimization, responsive design, and seamless third-party integrations

Technologies Used

Astro 4.x
UnoCSS
TypeScript
SSR
View Transitions
WebP
Sharp
Vercel
Calendly API
Beehiiv
Responsive Design
Performance Optimization
WCAG AAA
SEO Optimization

The Challenge: A Portfolio That’s All Show and No Go

Your portfolio is your #1 salesperson. It needs to be more than a gallery of past work; it needs to be a testament to your craft.

But most portfolios are slow, bloated with unoptimized images, and break on mobile. They have fancy animations that tank performance and third-party widgets that fail silently. It’s a classic case of prioritizing features over the fundamental user experience.

The real problem isn’t just showcasing your work. It’s building a platform that is the work—a high-performance, accessible, and perfectly engineered experience that proves your expertise before a visitor even reads a single line of your resume.

The Playbook: Engineer Performance as a Feature

You don’t need to choose between a beautiful site and a fast one. You need a better system.

This project is the playbook for turning a good portfolio into a great one. We took a functional website and systematically re-engineered it for elite performance, achieving near-perfect Lighthouse scores without sacrificing a single feature.

Here’s the framework for building a portfolio that converts.

1. The Performance Engine: A Static-First, Edge-Powered Architecture

The foundation of speed is shipping less. We built the site on a modern stack designed for minimal footprint and maximum velocity.

  • Static-First with Astro: By using Astro, we ensure the browser receives pre-rendered, blazing-fast HTML. We ship zero JavaScript by default, only “hydrating” interactive components as needed.
  • Atomic CSS with UnoCSS: Get all the power of a utility-first framework like Tailwind, but with an on-demand engine that generates only the styles you actually use, resulting in smaller, faster CSS.
  • Edge Deployment on Vercel: The site is served from Vercel’s global edge network, putting it geographically close to every visitor for the lowest possible latency.

2. The Optimization Gauntlet: A Systematic Purge of Inefficiency

This is where we separate the pros from the amateurs. We didn’t just build it; we optimized it, methodically.

  • Image Optimization Pipeline: We built an automated, build-time script using Sharp.js to convert all images to the modern WebP format and generate responsive variants. The receipt: a 74% average reduction in image file size with no perceptible loss in quality.
  • Critical Path Dominance: We eliminated all render-blocking resources by inlining critical CSS, preloading key fonts, and using preconnect hints for third-party scripts. The proof: a 1,480ms reduction in mobile load time.
  • Accessibility as a Mandate (WCAG AAA): We didn’t just aim for compliance; we achieved it. By fixing color contrast ratios and ensuring full keyboard navigation, we hit a 94-96/100 accessibility score.

3. The Integration Challenge: Taming Third-Party Scripts

Here’s what most developers get wrong: they just paste in a script tag. Calendly, Beehiiv, and other widgets can kill performance and break with modern frameworks.

  • The Problem: Astro’s View Transitions were breaking the Calendly widget on client-side navigation.
  • The Fix: We wrote a custom script to intelligently re-initialize the widget only when needed after a page transition, ensuring a seamless booking experience without duplicate or broken embeds.
  • The Security Tradeoff: Overly strict Content Security Policy (CSP) headers broke all integrations. We found the right balance, keeping essential security headers while allowing the third-party scripts to function correctly.

The Bottom Line

This project is the definitive case study in modern portfolio development. It proves that performance isn’t an afterthought—it’s the core feature that builds credibility and delivers a superior user experience.

With a systematic approach to optimization and the right technical stack, you can build a portfolio that doesn’t just show your work; it becomes your best work.