LoginSignup
4
4

More than 5 years have passed since last update.

Sassをコマンドラインからコンパイル

Last updated at Posted at 2014-08-30

sassのバージョンを確認します。CentOS環境です。

sass -v
Sass 3.4.2 (Selective Steve)

sassというディレクトリを作って、sassディレクトリに作ったsassファイルやscssファイルをコンパイルします。

mkdir sass
cd sass

現在のsassディレクトリをwatchします。

sassファイルをコンパイルするディレクトリをwatch

sassディレクトリをwatchします。

sass --watch ./:./

sassとscssファイルを作成

コンパイルされるかを確認します。まずはscssファイルをつくります。

vi hoge.scss

中身

SCSS
.hoge {
  width : 100px;
}

sassファイルを作ります。

vi huga.sass

中身

Sass
.hoge
  width: 100px

コンパイル結果

hoge.scssをコンパイルしたhoge.cssは

CSS
.hoge {
  width: 100px; }

huga.sassをコンパイルしたhuga.cssは

CSS
.hoge {
  width: 100px; }

感想

本当はGUIツールでコンパイルしたほうがいいです。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4