convertCASEpro

MODE

SCSS Formatter

Clean up SCSS so that nesting and declarations read clearly.

INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0

How the SCSS Formatter works

The formatter understands SCSS syntax beyond plain CSS: nested rules, parent selectors with an ampersand, variables, mixins and includes, functions, maps and control directives such as if and each. It prints each construct with consistent spacing and indentation.

Line comments, which are valid in SCSS but not in CSS, are preserved. If the input cannot be parsed, the first error is reported with its position.

When it is useful

  • •Normalizing partial files from different contributors.
  • •Reading deeply nested styles that were written on one line.
  • •Checking that a snippet is valid SCSS.
  • •Preparing code for review or documentation.

Frequently Asked Questions

Does it compile SCSS to CSS?

No, it only formats. To get CSS you need a compiler such as Dart Sass.

Can it format indented Sass syntax?

No. It expects SCSS with braces and semicolons.

Is the order of my rules changed?

Never. Formatting only changes whitespace and line breaks.

Related tools

[ Browse all tools ]