SCSS and Sass Compiler

Write or open several .scss and .sass files, compile them with the official Dart Sass in the page and copy expanded or minified CSS.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Write or open files

    Edit the sample, type your own Sass, or tap Open .scss / .sass files to load files from your device.

  2. 2
    Add partials

    Tap New file and give it a name such as _mixins.scss, then load it from the entry file with @use.

  3. 3
    Choose the entry file

    Select the main file and tap Make this the entry file so the star moves to it.

  4. 4
    Pick the output

    Choose Expanded or Compressed and turn on Source map if you want one.

  5. 5
    Read errors and warnings

    Fix anything shown under the editor; the line and column point to the problem.

  6. 6
    Copy or download

    Copy the CSS, or download the .css and .map files ready for your site.

About this tool

Sass adds variables, nesting, mixins, functions and modules to CSS, but browsers only read plain CSS, so every Sass file has to be compiled first. Normally that means installing Node and the sass package, or setting up a bundler, which is a lot of work for a quick test, a CodePen-sized snippet or a theme file you were sent by email. This page runs the official Dart Sass compiler, the same JavaScript build that npm installs, right in your browser. It is downloaded once from the jsDelivr CDN at a pinned version (1.80.6) and then cached. Your project can have several files: an entry file marked with a star, partials whose names start with an underscore, and folders such as base/_reset.scss. A custom importer resolves @use, @forward and @import between them from memory, following the same lookup rules as the command-line compiler: with or without the underscore, with or without the extension, and index files inside folders. Both syntaxes work, the brace-based .scss and the indentation-based .sass, and plain .css files can be loaded too. Choose expanded output for reading or compressed output for production, and turn on a source map, either as a separate .map file or inlined at the bottom of the CSS, so the browser developer tools point back to your Sass lines.

Errors you can act on

When Sass stops, the message appears under the editor with the file name, the line and the column, for example Line 4, column 12: Undefined variable. Warnings and deprecation notices, such as the long-running move from @import to @use or the change in how slash division works, are listed below the output so you can fix them before they become errors in a future Sass release.

Nesting outline

The outline tab reads the current .scss file and shows each nested selector next to what it becomes, with & resolved to the parent: &__title inside .card shows as .card__title, and a nested .x shows as .card .x. Media and supports blocks appear in the list without changing the selector. It is a quick way to spot nesting that has grown too deep or a selector that is far more specific than you meant.

Working with files

Open one or more .scss, .sass or .css files from your device, add new files, rename or delete them, and download any single file. The project is saved in your browser and as a JSON file with Save file, so you can continue on another computer.

Limits

The compiler is not available offline the first time, because it has to be downloaded (roughly a megabyte of JavaScript). It cannot load packages from node_modules such as Bootstrap or Bulma by name; paste the partials you need into the project instead. Custom functions written in JavaScript and the @import of remote URLs are not supported. Very large projects compile more slowly than the native command line, but small and medium stylesheets take milliseconds.

Worked example

The sample project has main.scss using _tokens.scss with $space: 8px, $radius: 12px and a $brand map of three colours. Compiling gives .card { padding: 16px; border-radius: 12px } plus a hover shadow using rgba(15, 23, 42, 0.15), a 24px padding inside a min-width 768px media query, and three helper classes .text-primary, .text-success and .text-danger from the @each loop. Expanded output is under 0.5 KB; compressed output drops the line breaks and spaces and comes out roughly a third smaller.

Quick facts

Frequently asked questions

Is this the real Sass compiler?

Yes. It is Dart Sass, the official implementation, in its JavaScript build. The page loads a pinned version from jsDelivr, so results match what npm install sass at that version gives you.

What is the difference between .scss and .sass?

SCSS uses braces and semicolons and accepts any valid CSS. The older indented syntax (.sass files) uses indentation instead of braces, has no semicolons, and writes mixins with = and +. Both compile to the same CSS, and files of both kinds can load each other.

Should I use @use or @import?

Use @use and @forward. They load each file once, give its members a namespace such as tokens.$space, and keep private members private. @import still works but is deprecated and will be removed in a future major version; this compiler shows the deprecation warning.

How do partials work here?

Create a file whose name starts with an underscore, such as _variables.scss, and load it with @use "variables". The underscore and extension can be left out. Partials are not compiled on their own; only the entry file marked with a star is.

What does the source map do?

It records which Sass line produced each CSS line. With the .map file next to your CSS, or the inline option, browser developer tools show your .scss file and line when you inspect an element.

Does my code leave the browser?

No. Only the compiler itself is downloaded. Your files are compiled in this page and saved only in this browser's storage.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages