Skip to content

Accessible Astro Starter

The Accessible Astro Starter is a ready-to-use, SEO and accessibility-friendly blogging theme. It provides a solid foundation with numerous accessible components, Tailwind CSS integration, and example pages including a dynamic blog, 404 page, and MDX support. Version 4.0.0 introduces a complete design system overhaul with OKLCH colors, Atkinson Hyperlegible font, and significant accessibility improvements.

  • Built on Astro 5.7.5
  • Tailwind CSS 4.0 integration
  • Modern OKLCH color system with light/dark mode
  • Atkinson Hyperlegible font for improved readability
  • Markdown and MDX support with examples included
  • Excellent Lighthouse/PageSpeed scores
  • ESLint with strict accessibility settings
  • Prettier integration with plugins for Astro and Tailwind
  • View Transitions support
  • Dynamic blog with pagination and breadcrumbs using AJAX fetch
  • Enhanced portfolio page with rich media support
  • Custom 404 error page
  • TypeScript interfaces and proper prop typing
  • Semantic HTML landmarks (header, main, footer, nav, etc.)
  • Proper heading hierarchy
  • ARIA attributes for enhanced screen reader support
  • Keyboard-accessible navigation with dropdown support
  • Skip links for main menu and content
  • Dark mode with system preference detection
  • Focus indicators that work on all backgrounds
  • Reduced motion preferences support
  • Screen reader only text utilities
  • Accessible components like Accordions, Breadcrumbs, Modals, and more
  • Color Contrast Checker component for accessibility testing
  • Modern CSS with logical properties
  1. Clone the repository:

    Terminal window
    git clone https://github.com/incluud/accessible-astro-starter.git
  2. Install dependencies:

    Terminal window
    npm install
  3. Start development server:

    Terminal window
    npm run dev
  4. Open your browser: Visit http://localhost:4321 to see your site in action.

The starter follows a clear and organized structure:

  • Directorypublic/
    • Directoryfonts/
    • // Other assets
  • Directorysrc/
    • Directoryassets/
      • Directoryimg/ // Contains the logo
      • Directoryscss/
        • Directorybase/ // Core styles and utilities
    • Directorycomponents/
      • CallToAction.astro
      • ContentMedia.astro
      • Counter.astro
      • Feature.astro
      • Footer.astro
      • Header.astro
      • Hero.astro
      • Navigation.astro
      • ResponsiveToggle.astro
      • SiteMeta.astro
    • Directorycontent/
      • Directoryprojects/
        • project-01.md
        • project-02.md
        • project-03.md
        • project-04.md
        • project-05.md
        • project-06.md
        • project-07.md
    • Directorylayouts/
      • DefaultLayout.astro
      • MarkdownLayout.astro
    • Directorypages/
      • Directoryblog/
        • […page].astro // Dynamic blog pages
        • [post].astro // Individual post pages
      • Directoryportfolio/
        • […page].astro
        • [project].astro
      • 404.astro
      • accessible-astro-components.astro
      • index.astro
      • markdown-page.md
      • mdx-page.mdx
  • package.json
  • astro.config.mjs
  • tailwind.config.js
CommandAction
npm installInstall dependencies
npm run devStart dev server at localhost:4321
npm run buildBuild for production
npm run previewPreview production build

The starter includes several pre-built accessible components, with several new additions in version 4.0.0:

  • CallToAction.astro - Styled block with a button
  • ContentMedia.astro - Content with media layout
  • Counter.astro - Icon and number counter
  • DarkMode.astro - Theme toggle with system preference
  • Feature.astro - Feature highlight component
  • Footer.astro - With customizable content
  • Header.astro - With responsive navigation
  • Hero.astro - Hero section component
  • Navigation.astro - Keyboard accessible dropdown navigation
  • ResponsiveToggle.astro - Mobile navigation toggle
  • SiteMeta.astro - SEO meta component
  • SkipLinks.astro - For keyboard users
  • ColorContrast.astro - Accessibility testing component for color contrast
  • PageHeader.astro - Consistent page titles component
  • Logo.astro - Standardized branding component
  • ExternalLink.astro - Link with proper external attributes
  • BlockQuote.astro - Content citation component
  • BreakoutImage.astro - Full-width image component
  • SocialShares.astro - Blog post sharing component

Extend or modify existing components in the src/components directory:

src/components/Header.astro
---
import Navigation from './Navigation.astro'
---
<header>
<Navigation />
<!-- Add your custom header content -->
</header>

The theme uses Tailwind CSS with additional SCSS utilities. Customize your theme in the following files:

  • Directorysrc/
    • Directoryassets/
      • Directoryscss/
        • Directorybase/
          • _reset.scss // CSS reset
          • _breakpoints.scss // Media queries
          • _buttons.scss // Button styles
          • _colors.scss // Color system
          • _font.scss // Typography
          • _outline.scss // Focus styles
          • _root.scss // Custom properties

Version 4.0.0 introduces a powerful OKLCH-based color system that makes it incredibly easy to create accessible color schemes. The best part? You only need to define your three brand colors, and the entire color palette is automatically generated!

:root {
// Just set these three brand colors in hex or any format
--brand-primary: #d648ff; // Your primary brand color
--brand-secondary: #00d1b7; // Your secondary brand color
--brand-neutral: #b9bec4; // Your neutral brand color
// The rest of the color palette is automatically generated!
}

The magic of this system is how it leverages OKLCH color transformations to create consistent, harmonious color palettes with proper contrast for accessibility. OKLCH (Lightness, Chroma, Hue) is a perceptually uniform color space that makes it easier to create accessible color combinations.

  1. Fork the repository on GitHub

  2. Create a new branch:

    Terminal window
    git checkout -b feat/your-feature-name
  3. Make your changes and commit them:

    Terminal window
    git commit -m "Add some feature"
  4. Push to your fork:

    Terminal window
    git push origin feat/your-feature-name
  5. Open a Pull Request on GitHub