- Docs
- framework-guide
- astrojs
AstroJS Installation
Use UnoCSS within your AstroJS project
Requires the following before installing:
Installation
-
Create new Astro Project
Create a new astroJS project if you don’t have oneShell
npm create astro@latest myapp cd myapp npm i -
Installation
Shell
npm i -D unocss @unifydev/preset-uiTo learn more about installing UnoCSS and PresetUI, check this guide -
Configuration
-
Theme : to configure your theme, follow this
-
Global : global general colors for background, text-color and border.
CSS Variables:root{ --bg: var(--c-white); --bg-subtle: var(--c-gray-50); --bg-surface: var(--c-gray-100); --bg-muted: var(--c-gray-200); --bg-surface-elevated: var(--c-gray-300); --fg: var(--c-gray-700); --fg-muted: var(--c-gray-600); --fg-title: var(--c-gray-900); --fg-subtitle: var(--c-gray-800); --border: var(--c-gray-200); --border-subtle: var(--c-gray-50); --border-light: var(--c-gray-200); --border-strong: var(--c-gray-300); --border-emphasis: var(--c-gray-400); }**Add Integration **import unoCSS from "unocss/astro"; export default defineConfig({ integrations: [ unoCSS({ injectReset: true }) ], }) -
-
Add interactivity (Optional)
If you’re willing to use interactive component then make sure to have Flexilla installed or the corresponding Flexilla PackageShell
npm i @flexilla/flexillaTo init all componentsscript.js
import {initFlexilla} from "@flexilla/flexilla" initFlexilla()