LoginSignup
0
0
iOS強化月間 - iOSアプリ開発の知見を共有しよう -

SassC::SyntaxError: Error: Incompatible units を解決する

Posted at

はじめに

rails6で開発してる時に以下のようなエラーが発生しました。

SassC::SyntaxError: Error: Incompatible units

これの解消方法です。

環境

Ruby 2.7.6
Ruby on Rails 6.1.6.1
node 16.20.1
sassc 2.4.0

Incompatible units

これが発生するscssの記述は以下です。

width: min(100% - 3rem, 960px);

エラーの内容は互換性の単位で比較しようとしていることです。
上記のscssはrailsのフロントで記載しており、sasscでコンパイルすることで発生する課題のようです。

エラーを解消するためには以下のいずれかで書き直します。

width: #{min(100% - 3rem, 960px)};
width: unquote("min(100% - 3rem, 960px)");

コンパイラに文字列として認識させることで対応できます。

0
0
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
0
0