Skip to main content

CSS to SCSS Converter

Convert your CSS code to clean, nested SCSS instantly.
Automatically nests selectors, extracts color variables, and handles pseudo-classes.

SCSS output will appear here...

How it works

Selector Nesting

Nested selectors like .card .title become properly nested SCSS blocks for cleaner, more maintainable code.

Color Variables

Repeated colors are extracted into $variables at the top of your SCSS for easy theming and consistency.

Pseudo & Media

Pseudo-classes like :hover use the & syntax, and media queries are nested inside selectors.

Conversion Features

What gets converted:

  • Descendant selectors (.parent .child)
  • Pseudo-classes (:hover, :focus, :active)
  • Pseudo-elements (::before, ::after)
  • Combinators (>, +, ~)
  • Media queries nested inside selectors
  • Hex colors to $variables

Example transformation:

// CSS
.btn { color: #3b82f6; }
.btn:hover { color: #2563eb; }
// SCSS
$primary: #3b82f6;
$primary-dark: #2563eb;
.btn {
color: $primary;
&:hover { color: $primary-dark; }
}