Online
Paste your CSS
/SCSS
/LESS
into dirtystylesheet.com and hit Clean
Via Command Line
Via command line you can re-format CSS
/SCSS
/Sass
using the sass-convert
script:
$ sass-convert messy.scss clean.scss
or CSS to SCSS:
$ sass-convert messy.css clean.scss
or SCSS to Sass:
$ sass-convert messy.scss clean.sass
The sass-convert
script is installed when you install Sass. It can convert any direction between: css, scss, and sass.
Learn more about sass-convert
:
- Access the built-in help:
$ sass-convert --help
- http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#syntax
- http://sass-lang.com/docs/yardoc/#executables
Advanced user tip: Because the sass
syntax is much stricter (only allowing one property: value
pair per line) you’re less likely to run into an issue with messy code.