Hello, fellow Hamlites,

I've just made the first major addition to Sass since the release of 
version 1.5: a way for selectors to directly reference their parent 
selectors. This allows you to easily and DRYly use pseudoselectors, add 
selectors at the base of the hierarchy, and various other useful things. 
The syntax is as so:

a.cool
  :color #f00
  &:hover
    :color #0f0
  &:visited #00f


You can also combine this with dynamically-set classes for the html 
element to get targeted styles. The following example uses the useful 
page_class helper, also newly added, which converts the controller and 
action names into class attribute format:

-# Haml template
%html{:class => page_class, :xmlns => "http://www.w3.org/1999/xhtml";, 
'xml:lang' => "en"}
  %head
    %title Example
  %body
    #main
      %p
        %strong Wow, this is a cool feature

// Sass template
#main
  :width 90%
  :font-size 0.8em
  p
    :background-color #447793
    strong
      :font-weight bolder
      :font-size 1.2em
      .pictures.view &
        :font-size 1em
        :padding 0 2em

Useful, no? This is available right now in Trunk (i.e. version 1.6), 
which can be installed using "./script/plugin install 
http://svn.hamptoncatlin.com/haml/trunk";.

- Nathan

--~--~---------~--~----~------------~-------~--~----~
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