RubyでSassの@functionを作ると色々やれて便利です。 CompassのConfig使うとより便利です。 RubyでSassの@functionを作る これはSassだけでやれます。 1. 適当なファイルを作って拡張子.rbで保存する。 2. ファイルの先頭でsassをrequireする文を書く require 'sass' 3. (2のつづきで)Rubyの構文に従ったモジュールを書く module MyExtension def sample(str) return Sass::Script::String.new("#{str}") end end 4. (3のつづきで)書いたモジュールをSassのFunctionsにincludeする module Sass::Script::Functions include MyExtension end これでincludeしたモジ