Nested Rules Using the LESS Framework

by Dan on February 23rd, 2011

Lately I’ve been toying with the LESS framework. With LESS, developers are able to use CSS variables, mixins and nested rules. I understand that variables and mixins can help a user code more efficiently, but what I was most interested in was the nesting. With LESS, we can code something like this:

#header {
  h1 {
    font-size: 26px;
    font-weight: bold;
  }
  p { font-size: 12px;
    a { text-decoration: none;
      &:hover { border-width: 1px }
    }
  }
}

This code will produce the following:

#header h1 {
  font-size: 26px;
  font-weight: bold;
}
#header p {
  font-size: 12px;
}
#header p a {
  text-decoration: none;
}
#header p a:hover {
  border-width: 1px;
}

Pretty neat if you ask me. Check it out at lesscss.org.

Little Big Details

by Dan on February 16th, 2011

I stumbled across this website yesterday and found it very intriguing. To me, the subtle details of a website or an app don’t get enough credit. This site showcases some of those small, but useful elements.

Little Big Details