# Need help with Compass configuration for Radiant

**URL:** <https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057>\
**Category:** Radiant CMS\
**Created:** [October 25, 2010, 7:52pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057 "2010-10-25T19:52:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [October 25, 2010, 7:52pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/1 "2010-10-25T19:52:28Z")

</div>

Radiant 0.9.1 (vendor’ed)  
SNS extension

I’d like to take advantage of various Compass Sass features within my  
Radiant layouts (e.g. border-radius, etc.).

Compass initialization file:

I pulled down the radiant/config/initializers/compass.rb file from  
Github and placed it into vendor/radiant/config/initializers

```
require 'compass'
require 'compass/app_integration/rails'
Compass::AppIntegration::Rails.initialize!

```

Compass configuration file:

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.

What am I doing wrong?

Many thanks,  
Wes G.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [October 25, 2010, 9:21pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/2 "2010-10-25T21:21:35Z")

</div>

I’m not on edge. Still doesn’t work for me.

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?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [October 25, 2010, 9:01pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/3 "2010-10-25T21:01:30Z")

</div>

You shouldn’t need any special measures. Have you tried just putting

@import compass/css3

At the top of one of your sheets? On edge that should just work.

Best,

Will

Please excuse speling. Fat thumbs.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [October 25, 2010, 10:32pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/4 "2010-10-25T22:32:35Z")

</div>

Changed my RADIANT\_ROOT/config/compass.rb file to compass\_config.rb  
and got the same behavior.

No compass mixins loaded.

You did mean the config. file and not the initializer file, right?

Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [October 25, 2010, 9:59pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/5 "2010-10-25T21:59:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [December 17, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/6 "2010-12-17T23:35:41Z")

</div>

Will,

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

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [October 26, 2010, 10:39am UTC](https://www.ruby-forum.com/t/need-help-with-compass-configuration-for-radiant/198057/7 "2010-10-26T10:39:50Z")

</div>

On 25 Oct 2010, at 20:20, Wes G. wrote:

> I’m not on edge. Still doesn’t work for me.
> 
> 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
