Daniel Green's Homepage

SASS Variables in Compiled SCSS?

I recently noticed some SASS variables in the compiled CSS output of our Rails app.  I looked all over the place, trying to determine how I broke compilation, to no avail.

The answer ended up being obscure but rather simple: SASS variables inside CSS functions like calc() need to use string interpolation.  So "calc($variable)" becomes "calc(#{$variable})".

Problem solved.

SASS SCSS Ruby on Rails