|
|
|
|
|
by aaronbrethorst
4839 days ago
|
|
You should learn one of them. It'll make your life so much easier that it's not even funny. They're also really straightforward (for the most part). So you know that Sass and Less allow you to nest rules, right? e.g.: .foo {
p {
// rules go here
}
}
translates into .foo p { rules go here }Here are the examples from the article: &:hover { opacity: 1; }
The ampersand simply means 'I am applied in the context of whatever rule I happen to be in'. So, .home { &:hover { } } is equivalent to writing this normal CSS: .home:hover {
}
@include is like #include in C. It literally includes the referenced content in the rules you're writing. That means that .home {
@include bg-size(60px,auto);
}
is including something that (inferring from the name, here) sets the background size for the element. Given the parameters, it probably expands into: .home {
background-size: 60px auto;
}
plus another rule for handling 2x images in Webkit.This is a variable. Nuff said. $sprite_url_2x: "http://turbo.paulstamatiou.com/assets/pstam-sprite-v2-@2x.png";
make sense? |
|
I am sure these is some extra magic you are not telling us, but given that you are assuming we don't know about SASS and Less, you are obviously missing something important :)