Feasibly, you could use mixins to accomplish what you're doing in Haml 2.2

@import nested_rules.sass
.index_page
  +index_page_nested_rules
.results_page
  +results_page_nested_rules

and inside nested_rules.sass you could declare your mixins:

= index_page_nested_rules
  some: sass-rules
= results_page_nested_rules
  some-more: sass-rules

On Dec 14, 2009, at 10:17 AM, Tim Underwood wrote:

> In Haml/Sass 2.0.9 I'm able to do something like this:
> 
> .index_page
>  @import index_page_nested_rules.sass
> 
> .results_page
>  @import results_page_nested_rules.sass
> 
> And then everything in index_page_nested_rules.sass was nested within
> my index_page class. But in Haml/Sass 2.2.15 I get this error:
> 
> "Sass::SyntaxError: Import directives may only be used at the root of
> a document."
> 
> Was support for this intentionally taken away?  Is there another way
> to accomplish the same thing?  Mixins kind of work but aren't as clean
> as the nested @import's.
> 
> Thanks,
> 
> -Tim
> 
> --
> 
> 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.
> 
> 

--

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.


Reply via email to