Apologies if this is the wrong place to post SASS questions - I
couldn't find a separate SASS forum so here goes...

Is it possible to insert Ruby code in a SASS file?

The reason is because I need two separate stylesheets which are almost
identical, and I want to keep things DRY (the only difference is the
graphics path).

My initial plan was something like this:

1. Create a SASS "template" file (called template.sass) which uses
__FILE__ to define graphics path:

    !template_path = "/images/#{File.basename(__FILE__)}"
    #header
     :background = "url(" + !template_path + "/bg.jpg)"

2. Link required sections to it:

    ln -s template.sass section1.sass
    ln -s template.sass section2.sass

3. Link to stylesheet for current section (note: sections are sharing
the same layout file):

    # in application.html.haml
    = stylesheet_link_tag @template

But I got stuck at step 1. Any suggestions? Is there a better way?

PS - Thank you Hampton, Nathan and Jeff for haml (and sass of course)
- brilliant code and documentation! As suggested in the docs, it _has_
inspired me to write cleaner code. Nice work! And make_resourceful is
awesome too...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to