I took a compass.rb from another (non-Radiant) project and placed it in
vendor/radiant/config. I changed the paths based on my current settings
for the SNS extension:
# This configuration file works with both the Compass command line
tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
project_path = Compass::AppIntegration::Rails.root
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
http_stylesheets_path = "/stylesheets"
sass_dir = "stylesheets/sass"
images_dir = "public/images"
http_images_path = "/images"
javascripts_dir = "public/javascripts"
http_javascripts_path = "/javascripts"
environment = Compass::AppIntegration::Rails.env
# To enable relative paths to assets via compass helper functions.
Uncomment:
# relative_assets = true
I @import compass/css3/border-radius in my Radiant-managed CSS (Sass)
file, but cannot use the “+border-radius” mixin within my CSS.
I was already putting @import compass/css3/border-radius at the top of
my sheet. Taking away the “border-radius” doesn’t change the outcome,
as you would expect.
I am still not successfully pulling in the compass mixins at all.
Does anyone know if there was anything besides the compass initializer
that was added to support Compass in Radiant?
Wes is using SNS, not Sheets (which is better and in Radiant edge)
Wes, change the name of your config file. I believe it will create
problems with compass.
It doesn’t really matter what you name the file, except ‘compass.rb’
apparently.
I didn’t see your response until just now. This seems to work for me.
Thanks for so much for the help!
Wes
======
class SnsSassFilter < StylesheetFilter
filter_name ‘Sass’
def initialize
# you can add Sass options in here to control your filter output
# just make sure you know the consequences of doing so (including
# that you may need to update all your stylesheets to yield a new
# LAST-MODIFIED date from the cache.
load_path = Radiant::Config[‘SnS.sass_directory’] || ‘css/sass/’ @sass_options = Compass.sass_engine_options @sass_options[:load_paths] += [File.join(RAILS_ROOT, ‘public’,
load_path)]
end
def filter(text)
begin
Sass::Engine.new(text, @sass_options).render
rescue Sass::SyntaxError
"Syntax Error at line #{$!.sass_line}: " + $!.to_s
end
end
end
I was already putting @import compass/css3/border-radius at the top of my sheet.
Taking away the “border-radius” doesn’t change the outcome, as you would expect.
I didn’t say it would. I said the rest of your changes were unnecessary,
but I didn’t realise you were still running SNS. Sorry. In that case,
you need to change the sns_sass_filter so that it passes through the
compass configuration. This is probably the right way:
def filter(text)
begin
Sass::Engine.new(text, Compass.sass_engine_options).render
rescue
…
end
end
and you do need the initializer.
best,
will
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.