FormatterHQ

SCSS to Stylus Converter

Convert SCSS to Stylus. Sass logic is evaluated with Dart Sass and the output uses Stylus’s minimal syntax without braces, colons or semicolons.

Input SCSS
Output STYLUS
Ready.

How to use the SCSS to Stylus Converter

  1. Paste your SCSS code into the Input editor, or use Sample, Upload file or Load URL.
  2. Press Convert. The SCSS is compiled first, then written out as Stylus.
  3. Check the status bar for errors such as an undefined variable, which are reported with a line number.
  4. Use Copy or Download above the output panel to take the Stylus output with you.

What the SCSS to Stylus converter does

This SCSS to Stylus converter compiles your SCSS with Dart Sass, which evaluates variables, mixins, loops and module functions, and then writes the result as Stylus in its minimal form. The output has no braces, colons or semicolons; nesting is expressed by 2-space indentation. It is useful when a Stylus project needs styles that were written in Sass, such as a snippet from documentation or a component from another code base.

Example

$brand:#0f766e;
@mixin focus($c:$brand){outline:2px solid $c}
.btn{padding:8px 16px;&:focus-visible{@include focus}&--ghost{background:transparent;border:1px solid $brand}}
.btn
  padding 8px 16px
  &:focus-visible
    outline 2px solid #0f766e

.btn--ghost
  background transparent
  border 1px solid #0f766e

In Stylus you could write the modifier as &--ghost inside .btn, just like in SCSS; the converter keeps it as a separate rule because it is a distinct class in the compiled CSS.

Recreating Sass logic in Stylus

SCSSStylus
$brand: #0f766e;brand = #0f766e (or $brand = #0f766e)
@mixin focus($c) { ... }focus(c) with an indented body
@include focus(red);focus(red)
@each $k, $v in $mapfor k, v in map
@if $dark { ... }if dark with an indented body
#{$name}{name}

Stylus supports most Sass concepts, so translating definitions by hand is straightforward once you have the evaluated rules from this converter.

Tidying the converted Stylus

The output is correct but flat, because it mirrors the compiled CSS. A few passes turn it back into idiomatic Stylus:

  1. Restore variables. Search for repeated literal values such as #0f766e and replace them with a variable defined at the top, for example brand = #0f766e.
  2. Re-nest modifiers. Move rules like .btn--ghost back under .btn as &--ghost, as described above.
  3. Rebuild mixins. Declarations that appear in several rules, such as a focus outline, can become a mixin again: focus(c = brand) with an indented outline 2px solid c.
  4. Recompile and compare. Run both the original SCSS and the tidied Stylus to CSS and diff the results to confirm nothing changed.

Stylus treats colons, semicolons and braces as optional, so you can keep a more CSS-like style while tidying if your team prefers it.

Limitations

  • Variables, mixins and functions are compiled away; the output contains values.
  • Partials and @use of local files cannot be loaded; paste their content.
  • Rules generated by @extend may appear as grouped selectors like .a, .b.

Check computed colors

Colors are one area where the output can look unfamiliar. Legacy functions such as darken() return hex values, but the newer sass:color functions may return colors as rgb() with percentage channels, for example rgb(8.14%, 64.02%, 59.68%). That is valid CSS and Stylus passes it through untouched, but you may want to replace such values with a hex code, or with a Stylus call like lighten(brand, 10%), when you tidy the converted file. Stylus's color functions are close to Sass's legacy ones, so results are similar but not always identical to the last digit.

Test the Stylus with the Stylus Compiler, or produce CSS straight away with SCSS to CSS. The conversion runs in your browser.

Frequently asked questions

Does the output keep SCSS variables?
No. Dart Sass compiles them to values first. Add Stylus variables by hand where values repeat.
Is the Stylus output valid without colons?
Yes. Stylus treats colons and semicolons as optional, and the converter uses the minimal form.
Can I convert Sass loops to Stylus loops?
The converter outputs the classes a loop generates, not the loop itself. Stylus has for ... in loops if you want to rewrite the logic.
Are comments preserved?
Block comments that survive Sass compilation are kept as /* */ comments. Sass // comments are removed during compilation.

Last updated October 3, 2026

Related tools

Stylus to SCSS Converter Convert Stylus to SCSS online. Rules sharing a selector are nested automatically. CSS to Stylus Converter Convert CSS to Stylus online. Rules sharing a selector are nested automatically. LESS to Stylus Converter Convert LESS to Stylus online. Rules sharing a selector are nested automatically. SASS to Stylus Converter Convert SASS to Stylus online. Rules sharing a selector are nested automatically. Stylus to CSS Converter Convert Stylus to CSS online. Compiles variables, mixins and nesting into plain CSS. Stylus to LESS Converter Convert Stylus to LESS online. Rules sharing a selector are nested automatically. Stylus Compiler Explore Stylus syntax in an online compiler: optional punctuation, variables, mixins and & references with live CSS and line-numbered errors. Stylus to SASS Converter Convert Stylus to SASS online. Rules sharing a selector are nested automatically. SVG Blob Generator Create random organic SVG blob shapes for backgrounds and illustrations. Adjust complexity and randomness, add a gradient and download the SVG. SVG Wave Generator Generate random SVG wave dividers for section breaks. Tune complexity, amplitude, layers and colour, then copy the SVG or a CSS background. CSS Animation Generator Generate CSS @keyframes animations — fade, slide, zoom, bounce, pulse, shake, spin and more — with duration, delay, easing and loop controls. CSS Background Pattern Generator Generate repeating CSS background patterns — stripes, polka dots, checkerboard, grid, zigzag and more — using only gradients, no images.