Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/manuel3108/svelte-bulma-template


https://github.com/manuel3108/svelte-bulma-template

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# svelte bulma template
This is a modified [svelte template](https://github.com/sveltejs/template), to include the bulma css, which is installed through npm.

## how to use
There are three options:
- use the github template feature, to create a new repository based on this codebase
- clone this repository and apply any changes you want+
- follow the steps in [setup](https://github.com/manuel3108/svelte-bulma-template#setup)

## setup
First install bulma and a rollup helper plugin:
```
npm i -D svelte-preprocess node-sass autoprefixer postcss
```

Go to your `rollup.config.js`
and apply the following changes:
```js
import svelte from 'rollup-plugin-svelte';
// ....
import sveltePreprocess from 'svelte-preprocess';

export default {
plugins: [
svelte({
preprocess: sveltePreprocess({
sourceMap: !production,
scss: {
includePaths: [
'node_modules',
'src'
]
},
postcss: {
plugins: [require('autoprefixer')()]
}
}),
// other svelte stuff
})
// all other plugins
]
};
```

Go to your `App.svelte` and import the following:
```js

@import "main.scss";

```

And ther you go!

You should now be able to use something like:
```html
Button
```
Now you should see a nice looking [Bulma Button](https://bulma.io/documentation/elements/button/)

If you are using VSCode, you should add the following file to make the language-server happy: `svelte.config.js`:
```js
const sveltePreprocess = require('svelte-preprocess');

module.exports = {
preprocess: sveltePreprocess(),
}
```