Hi Nathan, It's still useful for my purposes since I'm page-caching
the result to css files anyway... I'm not actually providing dynamic
access to rails code from within Sass. All this is doing is two passes
of conversion.

The FAQ says: "If you really need some sort of dynamic CSS, the best
thing to do is put only the snippet you need to dynamically set in the
head of your HTML document."

Makes sense, but the trouble is, if I'm reusing common colors and
other variables throughout the stylesheet, the part that's "only the
snippet" would end up bigger than the rest of the stylesheet!


Andrew Vit




On Mar 18, 11:46 am, Nathan Weizenbaum <[email protected]> wrote:
> There's a reason Sass doesn't allow dynamic access to Rails code - see
> the Sass section ofhttp://haml.hamptoncatlin.com/docs/rdoc/files/FAQ.htmlfor 
> a brief
> discussion. Sass is also fairly slow, since it's only compiled once,
> so this is probably far too slow for a production environment.
>
>
>
> On Wed, Mar 18, 2009 at 11:18 AM, Andrew Vit <[email protected]> wrote:
>
> > Here's a template handler for Rails that adds embedded ruby to Sass:
>
> >http://gist.github.com/81194
>
> > Drop that in your lib or initializers, and your sass templates in app/
> > views will be parsed through ERB before being compiled and served as
> > CSS. Works great with Compass too!
>
> > Does anyone think it's worth making into a plugin?
>
> > Andrew Vit
--~--~---------~--~----~------------~-------~--~----~
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