How to use autoprefixer and scss together in SvelteKit?

This page summarizes the projects mentioned and recommended in the original post on /r/sveltejs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • svelte-preprocess

    A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.

  • Continue to use tags

  • In svelte.config.js ... (import aliases can be whatever you want)
    1. import svelte_preprocess from 'svelte-preprocess'
    2. import autoprefixer from 'autoprefixer'
    3. pass the Svelte preprocessor to Kit's preprocess config option and pass the postcss plugin to that Svelte preprocessor:
  • svelte.config.js

    import svelte_proprocess from 'svelte-process'
    import autoprefixer from 'autoprefixer'
    
    const config = {
        // Consult https://github.com/sveltejs/svelte-preprocess for more info
        preprocess: [
            svelte_preprocess({
                postcss: {
                    plugins: [autoprefixer()]
                }
            })
        ]
    }
    

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts