1Create project
Run the following command to create a new Astro project:
Select your preferred starter template when prompted.
2Add the Preact Integration
To add Preact to your Astro project, execute:
Type y
for all questions to confirm the installation.
3Add Tailwind CSS 3
Follow the instructions in the Astro Tailwind CSS Guide to add Tailwind CSS.
Run the following command
Update astro.config.mjs
Import the Tailwind integration in yourastro.config.mjs
file and add it to theintegrations
array:
Configure Tailwind CSS
Add the following basic configuration to yourtailwind.config.js
file:
4Update TypeScript Configuration
Modify yourtsconfig.json
to include the following settings:
Install the Node.js types as a development dependency:
Update astro.config.mjs
Make the following changes to yourastro.config.mjs
:
Add the following overrides to yourpackage.json
:
5Install Additional Packages
Run the following command to install additional dependencies:
6Update Tailwind CSS Configuration
Modify yourtailwind.config.js
to include dark mode and extend the theme:
Add Base Styles
Create a CSS file (e.g.,styles.css
) and add the following base styles:
7Copy UI Components
To copy the UI components, run the following command: