frank icon indicating copy to clipboard operation
frank copied to clipboard

Using frank helpers in .sass files?

Open null1099 opened this issue 11 years ago • 2 comments

Hi, I would like to know if there's a possibility to use frank helpers from helpers.rb within .sass files. I've tried

-if is_ipad?
 sass goes here...

like I do successfully in .haml files, but it doesn't work. Error: "Invalid CSS after "-if is_ipad": expected selector, was "?" (Sass::SyntaxError)"

null1099 avatar Aug 23 '13 09:08 null1099

Unfortunately it's not possible. Helpers are only available in templates that support ruby code evaluation. It could be possible if frank went the route of chaining extensions and evaluating one after the other, but that would be a big rewrite.

Just curious, but why would you want the sass to be there or not based on if it's ipad or not? Wouldn't you want the css to be there always and just not be used on requests from ipads?

trvsdnn avatar Aug 23 '13 12:08 trvsdnn

Hi and thx for the quick reply. I'm using frank export with an ENV[mytarget]=platform, so I could handle some content (inside .haml) platformspecifically. For some image, the iPad doesn't render max-width: 100%; correctly so I would use a static value therefore. Would be great to apply the same logic as in the haml templates ;-) Again, thanks a lot for the reply and frank!

null1099 avatar Aug 23 '13 13:08 null1099