FormatterHQ

Stylus to LESS Converter

Convert Stylus to LESS. The Stylus is evaluated (variables, mixins, arithmetic) and the rules are re-nested using LESS brace syntax.

Input STYLUS
Output LESS
Ready.

How to use the Stylus to LESS Converter

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

What the Stylus to LESS converter does

This Stylus to LESS converter first compiles your Stylus with the site's built-in Stylus compiler, which evaluates variables, simple mixins and arithmetic, and then prints the resulting CSS as nested LESS. Because LESS is a superset of CSS with braces and semicolons, the output drops straight into a LESS project and compiles to the same styles. It is also a quick way to hand Stylus-based component styles to a team that maintains a LESS theme, such as a Bootstrap 3 or Ant Design 4 customization.

Example

brand = #0f766e
border-radius(r = 4px)
  -webkit-border-radius r
  border-radius r
.card
  border-radius(6px)
  color brand
  &:hover
    background rgba(brand, 0.1)
.card {
  -webkit-border-radius: 6px;
  border-radius: 6px;
  color: #0f766e;
  &:hover {
    background: rgba(15,118,110,0.1);
  }
}

The Stylus mixin that shares its name with the border-radius property expanded into the prefixed and unprefixed declarations. rgba(brand, 0.1) was converted to a standard rgba() value, because LESS would not know the Stylus variable brand.

Stylus to LESS mapping

StylusLESS
brand = #0f766e@brand: #0f766e;
pad(x = 4px) + body.pad(@x: 4px) { ... }
pad(8px).pad(8px);
{prefix}-btn@{prefix}-btn
color property value (no colon)color: value;

Use the table to rebuild shared variables and mixins in LESS; the converter's output provides the evaluated rules.

Worked example: restoring variables and mixins

Taking the converted .card rule from the example above, a few lines turn the evaluated output back into maintainable LESS:

@brand: #0f766e;

.border-radius(@r: 4px) {
  border-radius: @r;
}

.card {
  .border-radius(6px);
  color: @brand;
  &:hover {
    background: fade(@brand, 10%);
  }
}

LESS's fade() sets the alpha channel, so fade(@brand, 10%) compiles to the same rgba(15, 118, 110, 0.1) as the Stylus original. The -webkit-border-radius line has been dropped on purpose: current browsers do not need the prefix, and an Autoprefixer step can add any prefixes your browser targets still require.

Limitations

  • Stylus conditionals, loops, functions with return values, built-in color functions and @extend are not supported by the Stylus compiler used here, so remove or rewrite them before converting.
  • Variables and mixins are replaced by values in the output.
  • Rules inside @media are output inside a top-level media block.

Preparing Stylus before converting

A little preparation gives cleaner results:

  • Inline any @required or @imported files whose variables and mixins you use, since other files cannot be read.
  • Replace plugin mixins (for example from nib) with your own small mixin definitions.
  • Replace built-in color functions like lighten() with literal colors, or recreate them afterwards with LESS's own lighten(), which takes the same arguments.
  • Keep one indentation width throughout the file; mixing two and four spaces between sibling lines confuses indentation-based parsing.
  • Rewrite if blocks and for loops as plain rules; LESS guards and each() can express the logic afterwards.

Verify the LESS with the LESS Compiler, or get CSS directly from Stylus to CSS. Conversion happens in your browser.

Frequently asked questions

Will the LESS output compile to the same CSS as my Stylus?
Yes, for the supported subset of Stylus. The LESS is a nested version of the CSS the Stylus compiler produced.
Are Stylus mixins turned into LESS mixins?
No. They are expanded where they are called. Recreate reusable mixins in LESS by hand if needed.
Which Stylus features are unsupported?
Conditionals, loops, functions that return values, built-in color functions such as lighten(), and @extend.
Does it handle Stylus written with braces?
Yes. Indentation-based and brace-based Stylus are both accepted.

Last updated October 3, 2026

Related tools

LESS to Stylus Converter Convert LESS to Stylus online. Rules sharing a selector are nested automatically. CSS to Stylus Converter Convert CSS 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. SCSS to Stylus Converter Convert SCSS 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 SASS Converter Convert Stylus to SASS online. Rules sharing a selector are nested automatically. Stylus to SCSS Converter Convert Stylus to SCSS 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. CSS Border Radius Generator Set border-radius per corner in px or %, or shape organic blobs with the 8-value "fancy" border-radius syntax. Live preview and copyable CSS.