Giter Site home page Giter Site logo

svelte-sass-template's Introduction

A Svelte Template with SASS Support

This Svelte app is based on the project template at https://github.com/sveltejs/template, with the addition of SASS/SCSS support from svelte-preprocess.

It supports VSCode syntax highlighting out of the box, with the svelte.config.js file. For more on how this works, read Svelte with SASS/SCSS in VSCode.

It also should handle the other processors enabled by svelte-preprocess:

  • pug
  • coffeescript or coffee
  • less
  • scss or sass
  • stylus
  • postcss
  • globalStyle (transform <style global> into global styles.)

This project comes with node-sass as a dependency, for SASS support, but you'll need to install other packages if you want to support e.g. PostCSS.

What to Change

Starting fresh? Clone this template with degit dceddia/svelte-template-sass and you're all set.

Got an existing project? There are only a few changes to make:

  • npm install svelte-preprocess node-sass
  • Update rollup.config.js to add "preprocess" to the svelte plugin (you'll also need to import autoPreprocess)
/// rollup.config.js

// At the top, add this import:
import preprocess from 'svelte-preprocess';


/* ... */


// Add preprocess to the plugins:
export default {
  /* ... */
  plugins: [
    svelte({
      /* ... */
      preprocess: preprocess()
  }),
  /* ... */
}
  • Create svelte.config.js for VSCode support, and install the Svelte for VSCode extension.
// svelte.config.js
const preprocess = require('svelte-preprocess');

module.exports = {
  preprocess: preprocess()
};

svelte-sass-template's People

Contributors

dceddia avatar markjaquith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

svelte-sass-template's Issues

How to get SASS working with vscode?

Hi,

I tried this. The template comes with scss, not sass. There's a comment saying how to use sass, but it's by default scss โ€“ which is annoying considering that the name of the repo has sass and not scss :P

Also I have a problem with getting SASS syntax highlighting to work with Svelte. Do you have any information on how to make that work?

Your readme is wrong

change

  • degit dceddia/svelte-template-sass
  • degit dceddia/svelte-sass-template

slightly better experience ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.