{"id":904,"date":"2013-06-03T22:30:20","date_gmt":"2013-06-04T04:30:20","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=904"},"modified":"2013-06-03T22:30:20","modified_gmt":"2013-06-04T04:30:20","slug":"openwest-notes-do-more-with-lesscss","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/openwest-notes-do-more-with-lesscss\/","title":{"rendered":"OpenWest notes: Do more with LESSCSS"},"content":{"rendered":"<p>I attended <a href=\"http:\/\/jakefolio.com\">Jake Smith<\/a>&#8216;s presentation, &#8220;Do more with LESSCSS&#8221; at the OpenWest conference. Here are my rough notes.<\/p>\n<p>Why use <a href=\"http:\/\/lesscss.org\/\">LESSCSS<\/a>? Be organized in your CSS code &#8212; DRY principle (Do Not Repeat yourself)<\/p>\n<p>What is LESSCSS <em>not<\/em>?<\/p>\n<ul>\n<li>doesn&#8217;t solve IE or other browser bugs<\/li>\n<li>doesn&#8217;t save you from yourself.<\/li>\n<\/ul>\n<p>Gives you:<\/p>\n<ol>\n<li>variables, which are especially useful to help you reference paths or colors or fonts using String interpolation: &#8216;@{imgPath}divider.png&#8217;<\/li>\n<li>nesting. But don&#8217;t nest unless you really need to. Never go more than three levels deep on your nesting because it will bloat out your CSS.<\/li>\n<li>Normally, @import slows down page load times, but LESSCSS combines all your imports so that it&#8217;s a single HTTP GET.<\/li>\n<li>Hex math to make colors lighter or darker (as for visited links, etc.)<\/li>\n<li>Mixins &#8212; the heart of LESS.<\/li>\n<li>if\/else &#8212; called <em>guards<\/em>. It looks like a media query.<\/li>\n<li>scope &#8212; inherit the closest variable<\/li>\n<li>namespacing<\/li>\n<\/ol>\n<p>You can have less.js load and compile your less css. But don&#8217;t do it. Use CodeKit (a paid tool) instead to compile it before your browser sees it. It will minify it for you as well. There&#8217;s also the &#8220;Less App&#8221;, which is free. SimpleLESS works on Windows and Mac. And there&#8217;s LiveReload, which is a paid app for Linux, Windows and Mac. Or use the command line using Node.js&#8217;s nvm, then &#8220;lessc myfile.less output.min.css -x&#8221;<\/p>\n<p>There&#8217;s a LESS compiler for PHP, Ruby, etc., but <em>do not use them &#8212;<\/em>\u00a0they&#8217;re not being kept up-to-date.<\/p>\n<p><strong>LESS vs SASS<\/strong><\/p>\n<p>SASS has a built-in sprite generator. But Jake generates his own sprites.<br \/>\nLESS is gaining features of SASS, like @extend.<\/p>\n<p><strong>LESS 1.4<\/strong> will have (will be delivered by the end of the month):<\/p>\n<ol>\n<li>:extend() functionality<\/li>\n<li>math must be wrapped in parenthesis<\/li>\n<li>variables as default variables<\/li>\n<li>new math functions<\/li>\n<li>convert function: convert(5em, px)<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>I attended Jake Smith&#8216;s presentation, &#8220;Do more with LESSCSS&#8221; at the OpenWest conference. Here are my rough notes. Why use LESSCSS? Be organized in your CSS code &#8212; DRY principle (Do Not Repeat yourself) What is LESSCSS not? doesn&#8217;t solve IE or other browser bugs doesn&#8217;t save you from yourself. Gives you: variables, which are &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/openwest-notes-do-more-with-lesscss\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OpenWest notes: Do more with LESSCSS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-904","post","type-post","status-publish","format-standard","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=904"}],"version-history":[{"count":1,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/904\/revisions"}],"predecessor-version":[{"id":905,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/904\/revisions\/905"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}