Format Code Now
/
ConvertSCSS to Stylus Converter Next: BBCode to HTML Converter ›

SCSS to Stylus Converter

CV-56

Rewrite SCSS in Stylus form: indentation instead of braces, $name = value variables, name(args) mixins and calls. Sass features with no Stylus match are commented and listed.

Runs in your browser. Nothing is uploaded.

SCSS code

Stylus code

How to use it

  1. Paste your SCSS into the input box, or open a .scss file.
  2. Leave review notes on to list unsupported items.
  3. Choose the indent and press Convert to Stylus.
  4. Copy the Stylus or download it as a .styl file.

What converts

$gap: 8px becomes $gap = 8px, and $x: 1 !default becomes $x ?= 1. "@mixin box($w, $h: 2px)" becomes "box($w, $h = 2px)", and "@include box(1px);" becomes "box(1px)". Interpolation #{$x} becomes {$x}. Nesting, &, @media and @extend keep their form, and braces and semicolons are removed.

What is commented out

@if, @else, @each, @for, @while, @function, @return, @use, maps, %placeholders and nested properties differ too much from Stylus to convert safely. Each is kept as a comment and listed in the notes with its line number. An @include with a content block is flagged as well.

Not compiled here

This page's converter writes the Stylus; the Stylus compiler is not run on it. Test the result in your own build. If you want a reference for what the CSS should be, compile the SCSS with the SCSS to CSS tool and compare.

Error messages and what to do

MessageWhat it meansFix
Missing } to close the block opened on line 3.A rule or at-rule was opened with { and never closed.Add the missing } at the end of the block that starts on the named line.
Unexpected } on line 5: there is no block to close.There is a } with no matching {.Delete the extra } or add the { it belongs to.
Unterminated /* comment starting on line 2.A /* comment has no closing */.Close the comment with */.

Questions people ask

How do I convert SCSS to Stylus?

Paste the SCSS and press Convert to Stylus. Variables, mixins, includes, nesting and extends are rewritten, braces and semicolons are removed, and a note block lists what did not convert.

How are SCSS variables written in Stylus?

As $name = value, so $gap: 8px becomes $gap = 8px. A !default flag turns into the conditional assignment ?=, which only sets the variable if it has no value yet.

How do SCSS mixins look in Stylus?

A definition becomes name(args) at the top level and a call becomes name(args) inside a rule. A mixin with no parameters is written name() so Stylus reads it as a call.

What about @if and @each?

They are commented out and listed in the review notes, because Stylus control flow is written differently. Rewrite those parts by hand. Nothing is silently deleted.

Is the Stylus checked by a compiler here?

No. The Stylus compiler is not part of this page, so try the output in your build and compare the CSS with your SCSS result.

About this tool

Rewrites SCSS into Stylus syntax from its own parser. Variables become $name = value (!default becomes ?=), @mixin becomes a name(args) definition, @include becomes a call, interpolation #{} becomes {}, and braces and semicolons are removed. @if, @each, @for, @function, maps and @content differ so much in Stylus that they are commented out and listed in the review notes. The output is not run through the Stylus compiler on this page, so test it before you rely on it.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.