This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:
Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.
See Instead:
This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.
Recess is a code quality tool developed by Twitter meant to help you write better css by enforcing guidelines. Built on top of LESS, Recess can be used as a linter in your development process to keep your code clean and maintainable.
In this tutorial we will install Recess on a VPS running Ubuntu 12.04. You should already have your own virtual private server, as well as Node.js and NPM (Node Packaged Modules) installed. If you don’t, follow the steps outlined in this tutorial to get set up.
Once Node and NPM are on your virtual server, run the following command to install Recess:
npm install recess -g
So how exactly would you use this cool code helper? Well, there are a few standard rules about writing css. For instance, you should not overqualify selectors or use #ids in them. Recess has built in its configuration some of these rules, and you can have it run through your css files and have them checked.
After you install Recess, you have the following rules out-of-the-box:
To test it out, create a simple css file and paste in the following:
#my-id { color:red; } .my_bad_class { color:red; }
recess path/to/css/file.css
recess path/to/css/folder/*
recess path/to/css/file.css --noIDs false
recess path/to/css/file.css --noIDs false --noUnderscores false
recess path/to/css/file.css --config=path/to/config/.recessrc
{ "noIDs": false, "noUnderscores": false }
recess path/to/css/file.css --compile
recess path/to/css/file.css --compile > path/to/css/compiled-file.css
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!