http://gumbyframework.com/
ダウンロードしたパッケージでデフォルトの状態からすぐにSassファイルのコンパイルを試したところ、コンパイルエラーが発生してしまいました。
Sassコンパイラには「Prepros」を使っており、エラーの内容は下記です。
----------
Syntax error: Undefined operation: "power(golden_ratio(), 1) times 16px".
on line 52 of C:/***/gumby/sass/extensions/modular-scale/stylesheets/_modular-scale.scss
from line 23 of C:\***\gumby\Gumby-master\sass\gumby.scss
Use --trace for backtrace.
----------
※ファイルパスは一部削ってます。
対象の「_modular-scale.scss」を追ったところ、「golden_ratio()」の定義はscssファイル側には存在せず、下記ファイルの中に定義が存在しました。
sass/extensions/sassy-math/lib/sassy-math.rb
Ruby自体は疎いため、コンパイルの仕方が悪い可能性もあるのではと思いましたが、解決策をご存知の方がいましたらお教えください。
Compassの設定ファイル「config.rb」(※プロジェクトのルートに作成)で、利用するCompassプラグインを指定する事で動作する事を確認しました。
・CSSの常識が変わる!「Compass」、基礎から応用まで!
http://liginc.co.jp/designer/archives/11623
中で一番重要なのは「config.rb」というファイルです。デフォルトだと中は下記のようになっていると思います。
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
Compassの各設定が記述されているのが分かります。このファイルで様々な設定を行いますが必要最低限の設定だけ書くなら、以下の二つだけで大丈夫。
#cssのコンパイル先
css_dir = "stylesheets"
#sassファイルの保存先
sass_dir = "sass"
公式ページで設定一覧のレファレンスが載ってます、結構多くて通常なら要らないとは思うのですが、一応参考として。
Configuration Reference
・Compassの設定ファイル「config.rb」の編集方法
http://liginc.co.jp/web/html-css/css/53075
Compassのプラグインを追加
1行目
# Require any additional compass plugins here.
これは「コンパスのプラグインを追加するならここに書いてね」ということですね。
Compassのプラグインは公式サイトにもいろいろ載っています。
Plugins and frameworks | Compass Documentation
以下のようにしてプラグインを呼び出します。
# Require any additional compass plugins here.
require 'ninesixty'
require 'susy'
「Gumby-master」内の「config.rb」を開くと次のようになっています。
コメントに従って、「extensions_dir ~」および「Compass::Frameworks.register ~」の2行をコメントアウトし、さらに「require 'modular-scale'」を有効にします。
※「require 'sassy-math'」を一緒に有効にしても動作しますが、こちらはコメントアウトしたままでも動作しました。
# Require any additional compass plugins here. # Tell compass where to find local extensions # If you followed directions and ran 'gem install modular-scale' comment the next two lines out: extensions_dir = "sass/extensions" Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale")) # Uncomment these to use regular Ruby gems. # require 'modular-scale' # require 'sassy-math' ..(~ 以下略 ~)
次のページでは設定ファイルの公式リファレンスの日本語訳が紹介されています。
・[Compass] 超訳 Configuration Reference
http://tenderfeel.xsrv.jp/css/compass-css/1235/
※Gumby付属の「modular-scale」を使う場合の設定は分かりませんでした。
回答ありがとうございます!
2013/10/28 15:12:04紹介頂いた方法で試したところ、コンパイルすることができました!
config.rb内に思いきり「modular-scale」と目当てのキーワードがありましたね…
コンパイラに頼りきりで基本的な設定を見落としがちていました。
助かりました、ありがとうございます。