{"id":2791,"date":"2012-03-05T11:39:52","date_gmt":"2012-03-05T10:39:52","guid":{"rendered":"http:\/\/toki-woki.net\/blog\/?p=2791"},"modified":"2022-03-29T21:53:01","modified_gmt":"2022-03-29T20:53:01","slug":"least-a-css-to-less-tool","status":"publish","type":"post","link":"http:\/\/toki-woki.net\/blog\/p2791-least-a-css-to-less-tool","title":{"rendered":"Least, a CSS to LESS tool"},"content":{"rendered":"<p>A few months back I discovered the concept of CSS pre-processors. At that time I knew about <a href=\"http:\/\/lesscss.org\/\">LESS<\/a> and <a href=\"http:\/\/sass-lang.com\/\">Sass<\/a> and had to decide which one was the best option for me. I thought the concept was really cool but lacked a real project to start getting my hands dirty with it.<\/p>\n<p>Then I started working on a freelance project and <a href=\"http:\/\/crunchapp.net\/\">Crunch<\/a> came out; I was sold. This app made me choose LESS over Sass, which may not be the best of reasons, but it seems like I&#8217;m not the only one to pick this language. As you may know the second iteration of <a href=\"http:\/\/twitter.github.com\/bootstrap\/\">Twitter Bootstrap<\/a> also relies on LESS, even encouraging you to use Crunch.<\/p>\n<p>Saturday @ilovetypography <a href=\"https:\/\/twitter.com\/ilovetypography\/statuses\/176020173881483264\">tweeted this<\/a>:<\/p>\n<blockquote class=\"big\"><p>Dreaming of something that takes my CSS &amp; LESSifies it \u2014 automagically.<\/p><\/blockquote>\n<p>To which I <a href=\"http:\/\/twitter.com\/tokiwoki\/status\/176045036822216704\">replied that<\/a>:<\/p>\n<blockquote class=\"big\"><p>This seems possible! Will try and see if I can write such a tool, interesting idea\u2026<\/p><\/blockquote>\n<p>Sunday morning I started writing JavaScript, and a few hours later I had a good-looking script. Took some time to create a simple yet efficient UI, and that was it.\u00a0<a href=\"http:\/\/toki-woki.net\/p\/least\/\">Least<\/a>.<\/p>\n<p><a href=\"http:\/\/toki-woki.net\/p\/least\/\">The tool<\/a> takes basic CSS as an input and tries its best to output the LESS or Sass source it would correspond to (including nesting, classes and pseudo-classes). I also added an option to output something for the not-so-popular-but-interesting <a href=\"http:\/\/learnboost.github.com\/stylus\/\">Stylus<\/a> language.<\/p>\n<p>As you&#8217;ll notice in the footer of the tool&#8217;s page it&#8217;s a &#8220;five-hour project&#8221;. In order to have a decent UI as fast as possible I used Twitter Bootstrap, which has its downsides but fits perfectly this kind of projects. A &#8220;five-hour project&#8221; also means it may still be a bit buggy. Don&#8217;t hesitate to ping me on Twitter or to drop comments here.<\/p>\n<p>ps: Least both references LESS and &#8220;To Say the Very Least&#8221;, a track by Buck 65 on Vertex. Ah!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few months back I discovered the concept of CSS pre-processors. At that time I knew about LESS and Sass and had to decide which one was the best option for me. I thought the concept was really cool but lacked a real project to start getting my hands dirty with it. Then I started [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[129,89,149,152,150,151,153],"acf":[],"_links":{"self":[{"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/posts\/2791"}],"collection":[{"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/comments?post=2791"}],"version-history":[{"count":18,"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/posts\/2791\/revisions"}],"predecessor-version":[{"id":2810,"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/posts\/2791\/revisions\/2810"}],"wp:attachment":[{"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/media?parent=2791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/categories?post=2791"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/toki-woki.net\/blog\/wp-json\/wp\/v2\/tags?post=2791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}