0.1.3 • Published 6 years ago

@kazzkiq/svelte-preprocess-scss v0.1.3

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

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.