Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Ruby コードにコンパス スタイルの文字列があります。それをcss文字列に変換したい。config.rb の値をハッシュとして持っています。
関数呼び出しを介して文字列形式のコンパスを css (文字列) に変換するにはどうすればよいですか?
はい、できます:
require 'sass' scss_string = '@mixin test{width: auto}; div {@include test}' print Sass::compile(scss_string)
これは出力されます:
div { width: auto; }
ここに、このメソッドの Ruby ドキュメントへのリンクと、カスタマイズ方法に関する情報があります。