Here’s an example of LESS code to give you an idea of what it does:
@brand-color: #3879BD;
.rounded(@radius: 3px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
#header {
.rounded(5px);
a {
color: @brand-color;
&:hover {
color: #000;
}
}
}
and then you would precompile it to some CSS. Not anymore, now you can natively link to the less:
HTML:
Now less.js will unpack the file and do its thing... making sure that the final CSS will be fully cacheable. Less.js has been written as a CommonJS module so you can run it on the server via node, or in the browser on the fly.http://ajaxian.com/archives/do-less-with-less-js?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ajaxian+%28Ajaxian+Blog%29
http://fadeyev.net/2010/06/19/lessjs-will-obsolete-css/
No comments:
Post a Comment