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.