What the LESS to SASS converter produces
This LESS to SASS converter targets Sass's indented syntax, the brace-free format used in .sass files. Your LESS is compiled with the official less.js compiler, so variables, operations, mixins and color functions are evaluated. The CSS result is then re-nested by parent selector and printed with 2-space indentation, property: value lines and no semicolons. If you want braces instead, use LESS to SCSS.
Example
@brand:#0f766e;@gap:8px;
.card{padding:(@gap*2);border:1px solid @brand;.title{font-weight:600}&:hover{border-color:darken(@brand,10%)}@media (min-width:768px){padding:(@gap*3)}}
.card
padding: 16px
border: 1px solid #0f766e
.title
font-weight: 600
&:hover
border-color: #094944
@media (min-width: 768px)
.card
padding: 24px
(@gap*2) became 16px and darken() produced #094944. The media query that was nested inside .card in LESS was bubbled to the top level during compilation, so in the Sass output it wraps its own .card block. Sass also supports media queries nested inside selectors; move it back inside .card if you prefer that layout.
Rebuilding LESS features in indented Sass
| LESS | Indented Sass |
|---|---|
@gap: 8px; | $gap: 8px |
.shadow() { box-shadow: ... } | =shadow then an indented box-shadow: ... |
.shadow(); | +shadow |
@{prefix}-item | #{$prefix}-item |
e("...") / ~"..." | unquote("...") or plain value |
Since the converter outputs values instead of variables, add these definitions yourself where values repeat.
Checks after converting
- Indentation is significant in
.sassfiles. Keep the 2-space structure if you edit the output. - Multi-line comments are joined onto one line, as required by the indented syntax.
- Local
@importfiles cannot be read; include their content in the input. - Compile the result with the SASS Compiler to confirm it matches the original CSS.
SCSS or indented Sass as the target?
Pick the indented syntax if your team prefers minimal punctuation or already writes indentation-based templates such as Pug or Haml. Pick SCSS if you want to paste CSS snippets directly, or rely on formatters and linters: Prettier and most Stylelint setups support SCSS, but Prettier does not format indented .sass files. Both compile with Dart Sass to identical CSS.
Colors deserve a second look after any LESS migration. LESS and Sass implement functions such as darken() slightly differently, so recomputing a color in Sass can give a marginally different value. Because this converter keeps the value that LESS computed, the page looks exactly as before; if you later replace the literal with a Sass function call, compare the resulting hex codes.
The conversion runs in your browser and nothing is uploaded.