0

hi i am trying to convert the following following with compass, though i am getting a compile error stating 'Undefined mixin background-image'

#header_toolbar {
height: 40px;
/* The black toolbar gradient :) */
background: #313131; /* Old browsers */
@include background-image(linear-gradient(left top, #313131, #101010));
/*background: -moz-linear-gradient(top,  #313131 0%, #101010 100%); *//* FF3.6+ *//*
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#313131), color-stop(100%,#101010)); *//* Chrome,Safari4+ *//*
background: -webkit-linear-gradient(top,  #313131 0%,#101010 100%); *//* Chrome10+,Safari5.1+ *//*
background: -o-linear-gradient(top,  #313131 0%,#101010 100%); *//* Opera 11.10+ *//*
background: -ms-linear-gradient(top,  #313131 0%,#101010 100%); *//* IE10+ *//*
background: linear-gradient(top,  #313131 0%,#101010 100%); *//* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#313131', endColorstr='#101010',GradientType=0 ); /* IE6-9 */

}

gemfile

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'compass-rails'
  gem "compass", "~> 0.12.1"
end

1 Answer 1

2

You need to import the mixin in your scss:

 @import "compass/css3/images"

http://compass-style.org/reference/compass/css3/images/

Take a look here for an idea about getting your imports in one place rather than defining them in every scss file: http://compass-style.org/help/tutorials/best_practices/

Sign up to request clarification or add additional context in comments.

3 Comments

am i missing something here, but when i added that line i get found to import not found or readable
What do you have in your Gemfile? Are you using the compass-rails gem rather than the compass gem?
try moving compass and compass-rails outside of the assets group

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.