Skip to content

Instantly share code, notes, and snippets.

@sjungling
Last active December 17, 2015 03:18
Show Gist options
  • Save sjungling/5541843 to your computer and use it in GitHub Desktop.
Save sjungling/5541843 to your computer and use it in GitHub Desktop.
Sassify
@ECHO off
IF "%1"=="" (
FOR /R %%i in (*.scss) do sass-convert -F scss -T scss -i %%~ni
) ELSE (
FOR /R %%i in (*.scss) do IF "%1"=="%%~ni" (
sass-convert -F scss -T scss -i %%i
)
)

Sassify

Sassify is a quick and easy command line tool for cleaning up SCSS files. Think of it like an HTMLTidy or JSFormat but for SCSS.

With Sassify you can cleanup individual files sassify general.scss or an entire directory of files sassify sass/product/*.scss

Transform:

.title {
  h1 {
    padding: 16px 0 0 10px;
    margin: 0;
    color: #555;
  }
p {
  padding: 0 0 0 10px;
  color: #777;
}
  span {    font-size: 13px; padding-left: 10px;  font-weight: normal;   }
}

into

.title {
  h1 {
    padding: 16px 0 0 10px;
    margin: 0;
    color: #555;
  }
  p {
    padding: 0 0 0 10px;
    color: #777;
  }
  span {
    font-size: 13px;
    padding-left: 10px;
    font-weight: normal;
  }
}
#!/usr/bin/env bash
while [[ "$1" != "" ]]; do
if [[ -f $1 ]]; then
sass-convert -F scss -T scss -i $1
echo "SCSSS converting $1"
else
echo "Could not find: $1"
fi
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment