What is ">ul" means in SASS?

nuk picture nuk · Aug 5, 2013 · Viewed 18.5k times · Source

Here is the SASS code part:

#main-nav{
     >ul{
              blahblah
        }
}

So I want to know the exact mean of the string ">ul" means? I cannot find it in the SASS manual.

Furthermore, can it be translated to stylus?

Answer

Burhan Khalid picture Burhan Khalid · Aug 5, 2013

This the CSS syntax to select the child of an element. See this reference for more on how it works:

This selector matches all elements that are the immediate children of a specified element. The combinator in a child selector is a greater-than sign (>). It may be surrounded by whitespace characters, but if it is, Internet Explorer 5 on Windows will incorrectly treat it as a descendant selector. So the best practice is to eschew whitespace around this combinator.