Installation
Fastest way to get started with any framework is:
npx salty-css init
For a manual install on Astro, run:
npm i @salty-css/astro
Astro
- In your existing Astro repository you can run
npx salty-css initto automatically configure Salty CSS. - Create your first Salty CSS component with
npx salty-css generate [filePath](e.g.src/custom-wrapper). - Import your component in any
.astropage or layout and see it working!
Manual configuration
- Install the Astro integration:
npm i @salty-css/astro - Create
salty.config.tsin your project root. - Add the Salty CSS integration to
astro.config.mjs:import { defineConfig } from "astro/config"; import salty from "@salty-css/astro"; export default defineConfig({ integrations: [salty()], }); - Make sure that
salty.config.tsandastro.config.mjsare in the same folder. - Build the
saltygendirectory by running your app once or via the CLI:npx salty-css build [directory]. - Import global styles from
saltygen/index.cssin your global stylesheet:@import 'insert_path_to_index_css';.