Currently, there is not. I don't think we'll ever allow variables declared inside mixins to be accessed outside, since that violates encapsulation. We may allow previously-declared property values to be accessed, though, if there's a convincing use case for it.
One feature we certainly intend to add that I think would cover this use case is user-defined functions. These would allow you to write a function that would compute the value of the variable given a set of parameters, and then use that in all your mixins. On Tue, Mar 23, 2010 at 12:38 PM, sass_nerd <[email protected]> wrote: > I am trying to figure out if there is a way for a number that is > dynamically created inside of a mixin to be used by other mixins. > > In this example I am creating an !inner_width variable by subtracting > margins, borders, and padding from an !total_width value which is > passed in. > I would then like to be able to pass that number to another mixin (for > instance an element inside of the container using this) > > > =section(!total_width, !margin_width, !border_width, !padding_width) > !inner_width = !total_width - (!margin_width*2) - (! > border_width*2) - (!padding_width*2) > width = !inner_width > float: left > margin = !margin_width > border = !border_width "solid" !body_border_color > padding = !padding_width > > However when I try to call !inner_width in another mixin it is not > found. I guess this is a variable scope issue? Is there anyway for a > dynamically created value to be accessible across mixins? > > -- > 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] <haml%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > > -- 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.
