Rails SASS compiler does not know compass animation

I use

@include keyframes(small) {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.small {
  @include animation(small 1s infinite);
}

      

And rails is giving me the following error:

Sass::SyntaxError at /
Undefined mixin 'keyframes'. (or 'animation')

      

I am using latest SASS and compass --pre (alpha) which should support animation.

+3


source to share


2 answers


Try using the following combination of gems in your GemFile:

gem "sass", "~> 3.2.19"
gem 'sass-rails', '~> 4.0.4'
gem "compass", "~> 0.12.7"
gem 'compass-rails', '~> 2.0.0'

      



And then make sure you have the following lines at the top of your scss file:

@import "compass";
@import "compass/css3";

      

0


source


The next updates to the gemfile should do this ...



# compass 1.0 needed to use keyframe mixin
# but compass 1.0 needs Sass 3.3 (further below)
gem "compass", "~> 1.0" 
gem 'compass-rails'

# use sass-rails ~>5.0 to get Sass ~>3.3 
# needed for compass ~>1.0 
# which is needed for keyframes mixin
gem 'sass-rails', "~>5.0"

      

0


source







All Articles