Skip to content

alexnucci/astro-understated-theme

Repository files navigation

Understated

A minimalist theme for personal websites and blogs built with Astro, React, and TypeScript. Focused on clean design, performance, and accessibility.

Features

  • 🎨 Modern UI Components - Built on shadcn/ui and Radix primitives
  • πŸš€ Performance First - Static site generation with Astro, instant state changes
  • β™Ώ Accessible - WCAG compliant with full keyboard navigation
  • πŸŒ™ Dark Mode - Instant theme switching with system preference support
  • πŸ“± Responsive - Mobile-first design approach
  • πŸ” SEO Ready - Built-in SEO components and meta tags
  • πŸ“ MDX Support - Write content in MDX with component support
  • 🎯 Type Safe - Full TypeScript support
  • 🐳 Docker First - Containerized development environment

Tech Stack

Project Structure

src/
β”œβ”€β”€ components/         # UI Components
β”‚   β”œβ”€β”€ ui/           # shadcn/ui components
β”‚   β”œβ”€β”€ showcase/     # Component demos
β”‚   β”œβ”€β”€ display/      # Content display components
β”‚   β”œβ”€β”€ forms/        # Form-related components
β”‚   β”œβ”€β”€ interactive/  # Client-side interactive components
β”‚   β”œβ”€β”€ layout/       # Layout components
β”‚   β”œβ”€β”€ media/        # Media handling components
β”‚   β”œβ”€β”€ mdx/          # MDX-specific components
β”‚   └── seo/          # SEO components
β”œβ”€β”€ content/          # Content collections
β”‚   β”œβ”€β”€ pages/        # Static pages
β”‚   β”œβ”€β”€ posts/        # Blog posts
β”‚   └── showcase/     # Component documentation
β”œβ”€β”€ styles/           # Global styles
β”‚   └── tokens/       # Design tokens
└── types/            # TypeScript definitions

Component System

shadcn/ui Integration

We use shadcn/ui as our component foundation, with a focus on:

  • Zero-Runtime CSS - All styling through Tailwind
  • Accessibility - Built on Radix UI primitives
  • Customization - Fully customizable through Tailwind and CSS variables
  • Type Safety - Full TypeScript support

Current implementation status:

  • βœ… Core components (Accordion, Alert, Button, etc.)
  • βœ… Form components (Input, Label, etc.)
  • βœ… Navigation components
  • 🚧 Advanced components (ongoing)

See src/content/showcase/shadcn-gallery.mdx for live examples.

Component Organization

Components are organized by responsibility:

  • ui/ - shadcn/ui components and primitives
  • showcase/ - Component demonstrations and documentation
  • interactive/ - Client-side interactive components
  • forms/ - Form-related components
  • display/ - Content display components
  • media/ - Media handling components

Each directory includes its own README with detailed documentation.

Development

Using Docker (Recommended)

  1. Start the development environment:

    docker compose up -d
  2. View logs (optional):

    docker compose logs -f
  3. Stop the environment:

    docker compose down

Adding UI Components

To add a new shadcn/ui component:

  1. Start the development container:

    docker compose -f docker-compose.dev.yml up -d
  2. Add the component:

    docker compose -f docker-compose.dev.yml exec app bun run ui:add $COMPONENT_NAME

See src/content/showcase/theme.mdx for component customization docs.

Development Principles

  • Clean Code - Type-safe, elegant solutions without hacks
  • Docker First - All development in containers
  • Tailwind First - Utility classes over custom CSS
  • Component Driven - Consistent patterns with shadcn/ui
  • Zero Runtime - No unnecessary JavaScript or animations
  • Accessibility - WCAG compliance and screen reader support

Documentation

Comprehensive documentation in src/content/showcase/:

  • theme.mdx - Theme system and customization
  • shadcn-gallery.mdx - Component examples
  • token-system.mdx - Design tokens
  • accessibility.mdx - ARIA implementation
  • keyboard-navigation.mdx - Keyboard support

Current Development

We're currently working on:

  1. Component System Refinement

    • Standardizing file naming conventions
    • Simplifying token system
    • Aligning closer with shadcn/ui patterns
  2. Documentation Improvements

    • Expanding component examples
    • Adding more usage guidelines
    • Improving accessibility documentation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Follow our coding standards:
    • Use TypeScript for type safety
    • Follow Astro's component patterns
    • Use React for interactive components
    • Implement proper accessibility
    • Write meaningful documentation
  4. Submit a pull request

License

MIT License - See LICENSE file for details.

Image Handling

Images are stored in src/assets/ and optimized using Astro's built-in image processing:

src/
β”œβ”€β”€ assets/           # Image assets
β”‚   β”œβ”€β”€ posts/       # Blog post images
β”‚   β”œβ”€β”€ launches/    # Launch images
β”‚   └── showcase/    # Documentation images

Content Images

For content collections, use relative paths from the content file:

---
title: My Post
heroImage: "../../assets/posts/my-image.png"
heroImageAlt: "Image description"
---

Component Usage

Use the OptimizedImage component for consistent image handling:

---
import OptimizedImage from '@/components/media/OptimizedImage.astro';
import myImage from '@/assets/posts/my-image.png';
---

<OptimizedImage 
  src={myImage}
  alt="Image description"
  variant="hero"
/>

Images are automatically:

  • Converted to WebP
  • Optimized for size
  • Loaded with zero layout shift
  • Properly typed with TypeScript

About

A minimalist theme for personal websites and blogs built with Astro, React, and TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors