Accessible Astro Starter
Introduction
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.
Key features
- Built on Astro 5.0
- Tailwind CSS integration
- 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
- Custom 404 error page
Accessibility features
- 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
Getting started
-
Clone the repository:
Terminal window git clone https://github.com/incluud/accessible-astro-starter.git -
Install dependencies:
Terminal window npm install -
Start development server:
Terminal window npm run dev -
Open your browser: Visit
http://localhost:4321
to see your site in action.
Project structure
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
Directorylayouts/
- DefaultLayout.astro
- MarkdownLayout.astro
Directorypages/
Directoryblog/
- […page].astro // Dynamic blog pages
- [post].astro // Individual post pages
- 404.astro
- accessible-astro-components.astro
- index.astro
- markdown-page.md
- mdx-page.mdx
- package.json
- astro.config.mjs
- tailwind.config.js
Available commands
Command | Action |
---|---|
npm install | Install dependencies |
npm run dev | Start dev server at localhost:4321 |
npm run build | Build for production |
npm run preview | Preview production build |
Components
The starter includes several pre-built accessible components:
CallToAction.astro
- Styled block with a buttonContentMedia.astro
- Content with media layoutCounter.astro
- Icon and number counterDarkMode.astro
- Theme toggle with system preferenceFeature.astro
- Feature highlight componentFooter.astro
- With customizable contentHeader.astro
- With responsive navigationHero.astro
- Hero section componentNavigation.astro
- Keyboard accessible dropdown navigationResponsiveToggle.astro
- Mobile navigation toggleSiteMeta.astro
- SEO meta componentSkipLinks.astro
- For keyboard users
Customization
Styling
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
Components
Extend or modify existing components in the src/components
directory:
---import Navigation from './Navigation.astro'---
<header> <Navigation /> <!-- Add your custom header content --></header>
Contributing
-
Fork the repository on GitHub
-
Create a new branch:
Terminal window git checkout -b feat/your-feature-name -
Make your changes and commit them:
Terminal window git commit -m "Add some feature" -
Push to your fork:
Terminal window git push origin feat/your-feature-name -
Open a Pull Request on GitHub