Installation & Setup
Create SvelteKit project
Create a svelte-kit project with the commands below. Visit kit.svelte to view the official documentation:
npm create svelte@latest my-app
cd my-app
npm install
Install STWUI
Run the following command to add STWUI to your project:
npm i -D stwui
Install TailwindCSS
Run the following command to add STWUI to your project:
npx svelte-add@latest tailwindcss
npm install
Configure TailwindCSS
Modify your tailwind.config.cjs
file with the following:
module.exports = {
content: [
'./src/**/*.{html,js,svelte,ts}',
'./node_modules/stwui/**/*.{svelte,js,ts,html}'
],
plugins: [
require('@tailwindcss/forms'),
require('stwui/plugin')
],
darkMode: 'class',
};