1001Ferramentas
🔄Converters

Stylus to CSS Converter

Explains converting Stylus templates (optional braces/colons) into standard CSS with examples.

Suporta regras planas (sem aninhamento).

Stylus permite omitir { }, : e ;. Exemplo:

.btn\n  color white\n  padding 8px

Em CSS:

.btn { color: white; padding: 8px; }

Variáveis usam $nome = valor sem prefixo obrigatório.

Indented Stylus back to standard CSS

An old project written in Stylus, the people who wrote it long gone, and nobody wants to install a toolchain just to find out what a file actually produces. Or you want to drop a snippet into CodePen, which expects CSS. Paste the indented Stylus into the top box and the version with braces, colons and semicolons shows up below, ready to copy with one click.

Parsing goes by indentation: a line starting at column zero is a selector, an indented line is a declaration. Each declaration splits at the first whitespace, so the first word becomes the property and the rest becomes the value, which is why padding 8px 12px comes out as padding: 8px 12px;. Write it without the optional characters: leave the Stylus colon in and it is read as part of the property name, giving you a doubled colon.

Flat rules only. Nesting, &:hover, mixins, variables in the $name = value form, conditionals and arithmetic are not evaluated, and those lines end up as odd declarations inside the previous rule. For a real stylesheet, compile with the official tool (npm i -g stylus, then stylus -p file.styl). For a short flat snippet this is quicker, and it runs in the browser with copy and clear buttons.

Frequently asked questions

Does it resolve variables and mixins?
No. Nothing is evaluated; it is a line-by-line format translation. Variables and mixins need the real Stylus compiler.
Should I include colons in the input?
Better not. Write color white, with no colon and no semicolon. Leave color: white in and the output shows a doubled colon that you clean up by hand.
Does tab indentation work?
Yes, tabs and spaces both mark a line as a declaration. What matters is that selector lines start at column zero.

Related Tools