Skip to content
Svelte preprocessor for sass
Branch: master
Clone or download
Pull request Compare This branch is 2 commits ahead, 79 commits behind ls-age:master.
Latest commit fbeb78f Jun 14, 2018

README.md

svelte-preprocess-sass

Svelte preprocessor for scss (SASS)

Installation

npm install --save-dev @kazzkiq/svelte-preprocess-scss node-sass

Usage

Using rollup-plugin-svelte

// rollup.config.js
import svelte from 'rollup-plugin-svelte';
import { scss } from '@kazzkiq/svelte-preprocess-scss';
...

export default {
  ...
  plugins: [
    ...
    svelte({
      preprocess: {
        style: scss(),
      },
    }),
  ],
};

Now all <style> elements in your components that have a type="text/scss" or lang="scss" attribute will be preprocessed by sass.

Passing options to sass

The scss function passes the first argument to the sass compiler, e.g.:

...
scss({
  plugins: [
    ...
  ]
})

Filtering styles

The scss function passes the second argument to svelte-preprocess-filter, e.g.:

...
sass(
  {} // Empty sass options
  { all: true } // Preprocess all styles
)

For available options visit the sass documentation.

You can’t perform that action at this time.