Napoleon's Penguin Mascot

    @kazzkiq/svelte-preprocess-scss

    0.1.3 • Public • Published

    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.

    Install

    npm i @kazzkiq/svelte-preprocess-scss

    DownloadsWeekly Downloads

    2

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    16.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • kazzkiq