popular.Whilenotacomprehensivelookateithertool,itwillbeenoughtogetyou
started.
Whichpreprocessortochoosedependsonwhichsyntax,tools,environment,and
workflowyouprefer.Asidefrominstallationandcompilation,thebasicfeaturesof
LessandSassaresimilarenoughthatwe’lldiscusstheminparallel.Foramore
detailedexplorationofLessandSass,consultthedocumentationforeach.
Installing Less
Lessisavailableas:
■ aNode.js-basedtool,installablefromitspackagemanagernpm
■ atoolforRhino^3 ,Mozilla’sJava-basedJavaScriptengine
■ abrowser-basedtool
■ partofGUI-basedtoolssuchasKoala^4 ,Harp^5 ,andCodeKit^6
■ aclient-sideJavaScriptapplication
InstructionsforhowtousethefirstthreearecoveredontheLesswebsite.^7 We’ll
focusontheNode.js-basedtool.Itrustyou’veinstalledNodeandNPMafterreading
Chapter 2 .InstallingLessworksthesamewayasinstallingotherNPM-distributed
packages:
npm install -g less
LinuxandOSXusersmayneedtousesudo.Ifthecommandlinescaresyou,using
aGUI-basedtoolisperfectlyfine.YoucansafelyskipaheadtotheRulesetNesting
section.
Using Less from the Command Line
TousethecommandlineversionofLess,runlesscinaterminalwindow:
(^3) https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino
(^4) http://koala-app.com
(^5) http://harpjs.com/
(^6) https://incident57.com/codekit/
(^7) http://lesscss.org/
330 CSS Master