$em-base: 16px emCalc($pxWidth) $pxWidth / $em-base * 1em In Sass, you can write your own handy functions like so: //Courtesy of Foundation.
background: url("./img/beers/porter.png") no-repeat background: url("./img/beers/pilsner.png") no-repeat background: url("./img/beers/stout.png") no-repeat In LESS you can write a basic logic statement using a ‘guarded mixin’: when > 40%). While this is a nice thought for easing users into writing it, there are a few issues which make it a lot less fun to work with than Sass: Logic statements LESS aims to be as much like CSS in style, syntax and structure. This means you can easily harness all the power of your favorite framework without having to deal with the mess of using multiple tools.
If you are interested, I’ve also written about how to get started using Sass and the problems with pre-processors.īefore I begin my highly opinionated tirade, let me just mention that I learned LESS first. In this article I’ll explain why Sass really is the best and why you should start using Sass if you haven’t already. Usage Examples Convert CSV to JSON grunt.The Sass versus LESS argument has been done to death. See node-csv for other available options. List of fields or true if autodiscovered in the first CSV line. See xml2js for other available options cvs.delimiter inlineįorce indentation ("pretty printing") for YAML only. indentįorce indentation ("pretty printing") for JSON and YAML. Options typeĭefine content when using unknown extension.
In addition, the plugin should be listed in package.json as a devDependency, which ensures that it will be installed whenever the npm install command is run. If the plugin has been installed correctly, running grunt -help at the command line should list the newly-installed plugin's task or tasks.
Once that's done, add this line to your project's Gruntfile: grunt.loadNpmTasks( 'grunt-convert') If you haven't used grunt before, be sure to check out the Getting Started guide.įrom the same directory as your project's Gruntfile and package.json, install this plugin with the following command: npm install grunt-convert -save-dev Convert between XML, JSON and YAML, from one format to another.