CSS to Sass
Turn a CSS stylesheet into the indented Sass syntax. Valid CSS is valid input; nothing is reinterpreted.
What CSS to Sass does
CSS is a subset of both preprocessor syntaxes, so this is a re-layout rather than a translation: braces and semicolons out, indentation in. a::after { content: "}"; } keeps its brace, because the tokenizer knows a string from a block — the mistake a regular-expression rewrite makes on the first stylesheet it meets. Nothing is added that you did not write: no nesting is invented and no selector is rewritten.
How to use it
CSS to Sass: paste the CSS into the box above, and press Run to get the Sass below.
Worked example
Input:
.badge {
display: inline-block;
content: "→";
border-radius: 999px;
}
.badge--new {
border-radius: 4px;
}
Output:
.badge
display: inline-block
content: "→"
border-radius: 999px
.badge--new
border-radius: 4px
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads CSS and returns Sass; reloading the page discards both.
CSS is a subset of both preprocessor syntaxes, so this is a re-layout rather than a translation: braces and semicolons out, indentation in. `a::after { content: "}"; }` keeps its brace, because the tokenizer knows a string from a block — the mistake a regular-expression rewrite makes on the first stylesheet it meets. Nothing is added that you did not write: no nesting is invented and no selector is rewritten.
Turn a CSS stylesheet into the indented Sass syntax. Valid CSS is valid input; nothing is reinterpreted.
How to use it
CSS to Sass: paste the CSS into the box above, and press Run to get the Sass below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads CSS and returns Sass; reloading the page discards both.
What to Expect
Best for
- Converting CSS to Sass when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
.badge { display: inline-block; content: "→"; border-radius: 999px; } .badge--new { border-radius: 4px; }
Sample output
.badge display: inline-block content: "→" border-radius: 999px .badge--new border-radius: 4px
Frequently asked questions
How do I use the css to sass?
CSS to Sass: paste the CSS into the box above, and press Run to get the Sass below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.