既に作ってしまったWEBサイトのcssをscssに変換できたら保守が楽!
ということで逆変換ができないのかなーと探してみたらありました。

http://css2sass.heroku.com/

cssからscssまたはsass形式に変換してくれます。

ほっほー、便利やなー。

他にもないかなーと思ってさらに探したら、

sassをインストールしたら一緒に導入されるsass-convertというコマンドがあるとのこと。

$ sass-convert --help
Usage: sass-convert [options] [INPUT] [OUTPUT]

Description:
  Converts between CSS, indented syntax, and SCSS files. For example,
  this can convert from the indented syntax to SCSS, or from CSS to
  SCSS (adding appropriate nesting).

Common Options:
    -F, --from FORMAT                The format to convert from. Can be css, scss, sass.
                                     By default, this is inferred from the input filename.
                                     If there is none, defaults to css.
    -T, --to FORMAT                  The format to convert to. Can be scss or sass.
                                     By default, this is inferred from the output filename.
                                     If there is none, defaults to sass.
    -i, --in-place                   Convert a file to its own syntax.
                                     This can be used to update some deprecated syntax.
    -R, --recursive                  Convert all the files in a directory. Requires --from and --to.
    -?, -h, --help                   Show this help message.
    -v, --version                    Print the Sass version.

Style:
        --dasherize                  Convert underscores to dashes.
        --indent NUM                 How many spaces to use for each level of indentation. Defaults to 2.
                                     "t" means use hard tabs.
        --old                        Output the old-style ":prop val" property syntax.
                                     Only meaningful when generating Sass.

Input and Output:
    -s, --stdin                      Read input from standard input instead of an input file.
                                     This is the default if no input file is specified. Requires --from.
    -E, --default-encoding ENCODING  Specify the default encoding for input files.
        --unix-newlines              Use Unix-style newlines in written files.
                                     Always true on Unix.

Miscellaneous:
        --cache-location PATH        The path to save parsed Sass files. Defaults to .sass-cache.
    -C, --no-cache                   Don't cache to sassc files.
    -q, --quiet                      Silence warnings and status messages during conversion.
        --trace                      Show a full Ruby stack trace on error

なので、cssをscssに変換するならこんな感じ。

sass-convert -F css -T scss input.css output.scss

便利だー。

参考: