frank
frank copied to clipboard
Using frank helpers in .sass files?
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)"
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?
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!