Sass3.3の新機能を使うためにはアルファ版のCompassが必要のよう。
$ gem install sass
$ gem install compass --pre
しかしCompassインストールでエラー……。
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
下記を参考にしたら行けました。
ありがとうございます。
MavericksでC拡張を含むgemをインストールできない場合の対処法
$ gem install compass --pre
バージョンは以下です。
$ sass -v
Sass 3.3.10 (Maptastic Maple)
$ compass -v
Compass 1.0.0.alpha.21
Copyright (c) 2008-2014 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
BEM記法で便利な &
は、RC版ではインターポレーションが必要でしたが、現在のバージョンでは
.block {
&__element {
font-size: 10px;
&_key-value {
font-size: 12px;
}
}
}
これで
.block__element {
font-size: 10px;
}
.block__element_key-value {
font-size: 12px;
}
こういけます。
Source Map なんかも便利ですね。