Installation
Fastest way to get started with any framework is:
npx salty-css init
For a manual install on React, run:
npm i @salty-css/react
React + Vite
- In your existing Vite 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 for example to
main.tsxand see it working!
Manual configuration
- Install the Vite plugin and the core package:
npm i @salty-css/vite @salty-css/core - In
vite.config.tsimport the plugin and register it:import { saltyPlugin } from "@salty-css/vite"; export default defineConfig({ plugins: [saltyPlugin(__dirname)], }); - Make sure that
salty.config.tsandvite.config.tsare 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 app entry:@import 'insert_path_to_index_css';.