Overview
The portfolio uses Tailwind CSS v4 with the new Vite plugin architecture, providing a modern, performant styling system. The configuration leverages custom plugins for typography and animations while maintaining a minimal, clean setup.Dependencies
package.json
Vite Plugin Setup
Tailwind CSS v4 integrates directly with Vite using the@tailwindcss/vite plugin:
vite.config.ts
Tailwind CSS v4 uses a new plugin architecture with
@tailwindcss/vite that replaces the traditional PostCSS setup.CSS Import Configuration
The main CSS file imports Tailwind and registers plugins using the new v4 syntax:src/index.css
Plugin Details
tailwindcss-animate
Provides animation utilities like
animate-pulse used throughout the project@tailwindcss/typography
Adds prose classes for styled markdown content in blog posts
Theme Configuration
The project uses Tailwind v4’s@theme directive for custom configuration:
src/index.css
Border Radius
All border radius values are set to 4px using therounded-[4px] utility. The theme overrides default radius tokens to 0, requiring explicit values:
Example Usage
Commonly Used Utilities
Based on the source code analysis, here are the most frequently used Tailwind utilities:Layout & Spacing
Typography
The project uses explicit pixel values (e.g.,
text-[16px]) instead of Tailwind’s default scale (e.g., text-base).Colors
Animations
Responsive Design
Custom Variants
The project defines a custom dark mode variant:dark: prefix when a parent has the .dark class.
Base Layer Styles
The project applies global base styles:src/index.css
Extending the Configuration
To extend Tailwind CSS v4 configuration:Adding Custom Colors
Define color variables in:root and map them in @theme inline:
src/index.css
bg-custom, text-custom, etc.
Adding Custom Utilities
Use Tailwind’s arbitrary values or define custom CSS:Adding Plugins
Install the plugin and register it insrc/index.css:
src/index.css
Best Practices
Use Explicit Color Values
Use Explicit Color Values
The project uses hex colors with the arbitrary value syntax:This ensures color consistency across the design system.
Leverage Opacity Modifiers
Leverage Opacity Modifiers
Use Tailwind’s opacity syntax for color variations:
Maintain Consistent Spacing
Maintain Consistent Spacing
The project uses a consistent spacing scale:
- Small gaps:
gap-2,gap-2.5,gap-3 - Component spacing:
px-6,py-0.5,mt-4 - Section spacing:
mt-6,space-y-6,mt-16
Responsive Mobile-First
Responsive Mobile-First
Follow mobile-first responsive design:
Related
Design System
Explore the color palette, typography, and design tokens
UI Components
See how components use Tailwind classes