Svelteit Logo

Installation With Svelte

Note: The instructions below assume you have an existing Svelte project or you're starting a new project using

npx degit sveltejs/template my-svelte-project

and that you've already added Svelteit like so:

npm install -D @colorfuldots/svelteit

# or if you prefer yarn

yarn add @colorfuldots/svelteit --dev

Svelteit Configuration with Svelte

1. Install a PostCSS loader of choice. We recommend rollup-plugin-postcss

yarn add rollup-plugin-postcss --dev

2. Open rollup.config.js in your project and import the rollup-plugin-postcss module to the top of the file like so:

import postcss from 'rollup-plugin-postcss'

3. Add this config to your rollup.config.js plugins: [ ] like so:

    plugins: [],

4. Rebuild and restart your project:

yarn build && yarn dev

5. Import Svelteit CSS anywhere you'd like to use it. You should only have to do this once in your app's entry point. i.e. App.svelte

  import '@colorfuldots/svelteit/dist/css/svelteit.min.css'

Optional: you can alternatively import the css file using Svelte's built in components like so:

  <link rel="stylesheet" href="./path/to/library/svelteit.min.css" />

6. Add your components of choice like so:

  import { Button } from '@colorfuldots/svelteit'

  <Button title="Hello Svelteit" primary rounded />

That's It! Now you're ready to "Svelteit"!