[haml] Does Sass support dynamic variable names?

2011-04-14 Thread Victor Nystad
I'm writing a mixin for a grid for an iPad app, where the orientation of the iPad determines the property values. To avoid unnecessary repetition I'd like to use dynamic variable names. Lets say I have two variables: $portrait_width: 600px; $landscape_width: 900px; And then the mixin:

Re: [haml] Does Sass support dynamic variable names?

2011-04-14 Thread Chris Eppstein
You cannot dynamically construct variables. In sass 3.1 there's a new function called `if` so you can do this: width: if($orientation == portrait, $portrait_width, $landscape_width); chris On Thu, Apr 14, 2011 at 1:32 AM, Victor Nystad vnys...@gmail.com wrote: I'm writing a mixin for a grid

[haml] [sass] Convert px to int? (Simply want to change the units.)

2011-04-14 Thread Chris Roth
This seems like a simple enough thing to do, but I can't find it in the docs oddly enough. Is there a way to convert a value from pixels to an integer? For example: int(40px) == 40 Thanks! -- You received this message because you are subscribed to the Google Groups Haml group. To post to

Re: [haml] [sass] Convert px to int? (Simply want to change the units.)

2011-04-14 Thread Chris Eppstein
40px / 1px will do the trick. On Thu, Apr 14, 2011 at 2:15 PM, Chris Roth chrisr...@gmail.com wrote: This seems like a simple enough thing to do, but I can't find it in the docs oddly enough. Is there a way to convert a value from pixels to an integer? For example: int(40px) == 40

[haml] Re: [sass] Convert px to int? (Simply want to change the units.)

2011-04-14 Thread Chris Roth
Perfect! Thanks, that gets the job done. Still advocate the addition of an int() function. I feel that that would be a little more elegant :p On Apr 14, 5:18 pm, Chris Eppstein ch...@eppsteins.net wrote: 40px / 1px will do the trick. On Thu, Apr 14, 2011 at 2:15 PM, Chris Roth

Re: [haml] Re: [sass] Convert px to int? (Simply want to change the units.)

2011-04-14 Thread Chris Eppstein
It's trivial to build. But I've yet to find a compelling use case for such a function. On Thu, Apr 14, 2011 at 2:33 PM, Chris Roth chrisr...@gmail.com wrote: Perfect! Thanks, that gets the job done. Still advocate the addition of an int() function. I feel that that would be a little more