The thing that worries me about this is that it might cause people to assume that Sass works like a view and try to access real dynamic stuff, like models and so forth. Especially since this wouldn't actually /break/... !background = @user.wallpaper_path would run and compile fine, but !background would have the same value for every request until the stylesheet is changed. Except in development mode, when :always_update is set by default, thus confusing the issue even more.
- Nathan James Walker wrote: > I'd love to see something like this because then I'd be able to return > strings which drew information from elsewhere - IE the image_path() > method. > > Consider the 'url' for a background - it's going to reference an image > in your public dir. > > Unfortunately we might develop our apps with no root prefix, so the > urls look like backgrounds/something.gif > and then we deploy our apps to production with a prefix, so the urls > look like prefix/backgrounds/something > .gif > > We get around this using a variable which we store the prefix in, but > it means we have to remember to patch the sass file before we go to > production. > > Claiming we should develop our apps with a prefix is all very well, > but we like the ability to move things around, even in production, and > this hardcoded image path is the only thing that gives us problems. > > > On 20/11/2007, *Evgeny* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > If you change the color names, with their function when naming > variables. > You can get the same effect by just replacing import(theme1) with > import(theme2) > and each such theme would contain something like > body_bg = .... > body_fg = ... > > > Somewhat easier than generating sass inside a helper. > > > On Nov 19, 2007 10:45 PM, Hampton <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > You very well might be on to something. > > Though, I'd like to improve the helper API for that though. > Perhaps > use something more like our Haml helpers. > > def make_theme(body_id,p_color,p_background) > open :body, :id => body_id do > open :p do > set.background = p_background > set.color = p_color > end > end > end > > Maybe something like that? > > Where would we define those? > > -hampton. > > On Nov 19, 2007 3:08 PM, pimpmaster <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > > I know I may get pelted with eggs for even suggesting this, > but I've > > been running across some repetitive code in my stylesheets > that would > > be remedied with a little helper love in Sass. In particular > writing > > styles for pages that have similar designs but different > color schemes > > (where user preferences set the scheme) can be very painful > to write > > > > body#seagreen > > p > > :background = !algae > > :color = !caribe > > > > body#candyred > > p > > :background = !swedish_fish > > :color = !wintermint > > > > // etc etc etc > > > > What I wish I could do is write my own helpers for Sass > > > > def make_theme(body_id,p_color,p_background) > > "body##{body_id}" > > " p" > > " :background = #{p_background}" > > " :color = #{p_color}" > > end > > > > Then I could just do this for each theme > > > > make_theme('candyred','!swedish_fish','!wintermint') > > > > Is this idea totally wacked, or am I actually onto something > here? > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
