CSS to Stylus Converter
Convert plain CSS into the concise Stylus syntax, without braces or semicolons. Paste your CSS and copy the Stylus to modernize your project styling.
Copiado!
Suporta regras planas (sem aninhamento).
Em Stylus você pode omitir os caracteres opcionais. Por exemplo:
/* CSS */\n.h1 { font-size: 32px; color: #333; }\n\n/* Stylus */\n.h1\n font-size 32px\n color #333From CSS to the leaner Stylus syntax
Stylus lets you drop braces, colons and semicolons, which feels odd at first if you came from CSS. Seeing the same rule in both shapes is the fastest way to build the habit, and it saves time when a snippet arrives as CSS while your project is all .styl files. Paste the CSS and the Stylus version shows up below, two spaces per declaration.
The parser works on flat rules: for each block, the selector becomes a line of its own and the declarations follow indented, with property and value separated by nothing but a space. So color: #333; turns into color #333. Since Stylus accepts both shapes, the result compiles the same whether you keep this output or put the punctuation back to match house style.
One catch: a block inside a block does not survive. Send in a media query and the inner rules convert while the @media line evaporates, so convert those pieces separately and reinsert the wrapper with the content indented beneath it. A /* */ comment attaches itself to the following selector. The converter also does not nest selectors or extract variables, which is most of the point of Stylus, so that work stays yours. Copy and clear included, all in the browser.
Frequently asked questions
Do I really have to remove the colons?
What happens to media queries?
Does it create variables and nesting?
Related Tools
Stylus to CSS Converter
Explains converting Stylus templates (optional braces/colons) into standard CSS with examples.
SCSS to CSS Converter
Strips simple SCSS features (variable declarations and // comments) producing an approximate CSS for inspection.
CSS to LESS Converter
Convert CSS stylesheets to LESS syntax, turning custom properties (--var) into @variables. Modernize your CSS and copy the ready-to-use code.
CSS to SCSS Converter
Adapts CSS to SCSS preserving rules and turning CSS custom properties into SCSS variables when detected.
LESS to CSS Converter
Strips LESS @variables and // comments producing approximate CSS suitable for visual checking.
CSS to SASS Converter
Convert plain CSS to the indented SASS syntax, without braces or semicolons. Paste your CSS and copy the SASS to modernize your project styling.