开发者

Rails compass libraries

开发者 https://www.devze.com 2022-12-15 11:42 出处:网络
I have installed compass via rubygems doug:aggio davide$ sudo gem list compass * LOCAL GEMS * compass (0.10.0.pre2)

I have installed compass via rubygems

doug:aggio davide$ sudo gem list compass

* LOCAL GEMS *

compass (0.10.0.pre2) compass-colors (0.3.1)

* LOCAL GEMS *

fancy-buttons (0.3.7)

* LOCAL GEMS *

haml (2.2.16, 2.2.14, 2.2.13, 2.2.10, 2.2.9, 2.2.6, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.0.10, 2.0.9) haml-edge (2.3.100, 2.3.97, 2.3.83, 2.3.67, 2.3.62, 2.3.43, 2.3.29, 2.3.27, 2.3.21, 2.1.56, 2.1.41, 2.1.8, 2.1.3)

Rails configurations

compass.rb

require 'compass'
require 'compass-colors'
require 'fancy-buttons'


# If you have any compass plugins, require them here.
Compass.configuration.parse(File.join(RAILS_ROOT, "config", "compass.config"))
Compass.configuration do |config|
  config.project_path = RAILS_ROOT
  config.sass_dir = "app/stylesheets"
  config.css_dir = "public/stylesheets/compiled"
end

Compass.configuration.environment = RAILS_ENV.to_sym
Compass.configure_sass_plugin!

compass.config

# Require any additional compass plugins here.

project_type = :rails
project_path = RAILS_ROOT if defined?(RAILS_ROOT)
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/stylesheets/compiled"
sass_dir = "app/stylesheets"
images_dir = "public/images"
javascripts_dir = "public/javascripts"

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
http_images_path = "/images"
http_stylesheets_path = "/stylesheets"
http_javascripts_path = "/javascripts"

this is some information about compass:

doug:aggio davide$  ./script/runner "require 'pp'; pp Sass::Plugin.options" 
{:style=>:expanded,
 :line_comments=>true,
 :css_location=>"/Users/davide/Code/aggio/public/stylesheets",
 :cache_location=>"/Users/davide/Code/aggio/tmp/sass-cache",
 :template_location=>"/Users/davide/Code/aggio/app/stylesheets",
 :always_update=>false,
 :always_check=>true,
 :full_exception=>true}

the main problem is the template location(compass libraries?). when i import blueprint.sass or other resources exaple fancy buttons, compass doesn't find libraries and return this

File to import not found or unreadable: blueprint.sass

But if i copy blueprint and compass libraries inside /app/stylesheets it works good. My questi开发者_StackOverflow社区on is: i need every time to extract libraries from compass gems, or there is a problem with paths?


If you're running Compass 0.10 the problem is probably because the libraries have been converted to the scss syntax and you're calling for "blueprint.sass".

You can reference them without the extension and it should work fine:

@import 'blueprint'

Also, compass-colors is no longer needed, those functions have been rolled into sass (in the haml gem).

Update: It's no longer part of the haml gem, it's a standalone sass gem now.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号