Differences Between Sass and LESS Preprocessors - The ...
文章推薦指數: 80 %
Syntactically Awesome Stylesheets (Sass) and Leaner CSS (LESS) are both CSS preprocessors. They are special stylesheet extensions that make ... TechnologyCareers Skills SassandLESSPreprocessors Webdevelopersshouldbefamiliarwithoneorbothpreprocessors By LaurenceBradford FullBio LinkedIn Twitter LaurenceBradfordwroteaboutcomputerprogrammingforTheBalanceCareers.Sheisaformercopywriterturnedfront-enddeveloper. Learnaboutour editorialpolicies UpdatedonNovember20,2019 CokeorPepsi,MacorPC,MarvelorDC? Ineverycommunity,there’sadebateoverwhichisbetter. Forwebdesignersordevelopers,thatdebateisSassorLESS. SyntacticallyAwesomeStylesheets(Sass)andLeanerCSS(LESS)arebothCSSpreprocessors.Theyarespecialstylesheetextensionsthatmake designingeasierandmoreefficient.BothSassandLESScompileintoCSSstylesheetssothatbrowserscanreadthem.Thisisanecessarystepbecausemodernbrowserscannotread.sassor.lessfiletypes. Ifyouplanonbeingintheworldofwebdevelopment,it’sagoodideatobewell-versedinoneofthetwopreprocessors—ifnotbothofthem. Whenitcomesdowntoit,theyhavealotofsimilarities.TheymakewritingCSSsimpler,moreobject-oriented,andmoreenjoyable.Nevertheless,thereareafewkeydifferences. SassIsinRubyWhileLESSIsinJavascript ShannonFagan/GettyImages SassisbasedinRubyandrequiresaRubyinstall.ThisisnobigdealifyouhaveaMac.However,itisalongerinstallationifyouhaveaWindowsmachine. LESSwasconstructedinRuby,likeSass,butithasbeenportedtoJavaScript.TouseLESS,youmustuploadtheapplicableJavaScriptfilestoyourserverorcompiletheCSSsheetsthroughanofflinecompiler. ToAssignVariables,SassUses'$'WhileLESSUses'@' LuisAlvarez/GettyImages BothSassandLESSusespecializedcharacterstoassignvariables.Thisispartofthebenefitofusingthesepreprocessors.Youdon’thavetokeepenteringspecificationseverytimeyouwanttoassignvariables.Instead,youcanjustenterthecharacter. InSass,it’sthedollarsign($).InLESS,it’sthe"at" symbol(@).TheonlydownsideforLESSisthatthereareafewexistingCSSselectorsthatalreadyuse@.Thatcomplication couldstiffenthelearningcurveabit. SassHasCompassWhileLESSHasPreboot Caiaimage/GerttyImages SassandLESShaveextensionsavailabletointegratemixins(theabilitytostoreandshareCSSdeclarationsthroughoutasite). Sassuses Compassformixins,whichincludeseveryoptionavailablewithupdatesforfuturesupport. LESShasPreboot.less,LESSMixins,LESSElements,gs,andFrameless.LESS’ssoftwaresupportismorefragmentedthanSass,resultinginalotofdifferentoptionsforextensionsthatmaynotallfunctionthesameway.Foryourproject,youmayneedtousemultiple(orall)ofthelistedextensionstoreplicatetheperformanceofCompass. LESSHasBetterErrorMessagesThanSass RazvanChisu/GettyImages BothSassandLESShavebeentestedfortheirabilitytoreporterrorsinsyntax.LESShasmoreaccurateerrormessagesinthe tests—itreportedthecorrectlocationoftheerror.Thiscancomeinhandywhenatypoisderailingthecode.LESSerrormessagescanhelpyouquicklyidentifytheproblem. LESSHasMoreUser-FriendlyDocumentationThanSass HeroImages/GettyImages TheLESSdocumentationisvisuallyappealingandeasiertofollowforfirst-timeusers.TheSassdocumentationrequireseithermuchmoreofbaseknowledge,orfrequentcross-referenceswithawikiduringsetup. ThisfactinandofitselfcouldweighheavilyontheadoptionratesofeitherSassorLESS. Share Tweet Share Email BestBookWritingSoftwareof2022 TheBestOnlineCodingClassesin2022 DiscovertheCoreSkillsYouNeedtoMasterasaFront-EndDeveloper Example:WebDeveloperResumeWithSummaryStatementExample Front-EndWebDeveloperCoverLetterandResumeExamples PlacestoLearnJavaScriptOnline 18ProgrammersYouShouldFollowonTwitter TheBestJobOptionsforTradeSchoolGraduates What'stheDifferenceBetweenaResumeandaCurriculumVitae? WebDeveloperJobDescription:Salary,Skills,&More TheSkillsYouNeedtoBeaBack-EndDeveloper 19TechTermsYouShouldKnow 10RewardingJobsYouCanGetWithoutaFour-YearDegree BestPlacestoLearntoCodeforFree 100+FreeProfessionalResumeExamples HateWorkinginanOffice?TheseArethePerfectJobsforYou
延伸文章資訊
- 1SASS vs LESS: What to Choose? - Cynoteck
Sass and LESS are two popular CSS Pre-processors. One of these tools is a scripting superset of C...
- 2SASS vs LESS vs SCSS - That are the differences - Ionos
Both preprocessors share some of the same properties: Both SASS and LESS allow for the use of mix...
- 3CSS 預處理器SASS、LESS 介紹 - 歐斯瑞
CSS 預處理器技術已經非常的成熟,而且也湧現出了越來越多的CSS 預處理器語言,比如說:. SASS(SCSS); LESS; Stylus; Turbine; Switch CSS; CSS...
- 4Differences Between Sass and LESS Preprocessors - The ...
Syntactically Awesome Stylesheets (Sass) and Leaner CSS (LESS) are both CSS preprocessors. They a...
- 5Differences between SCSS and LESS - sass - Stack Overflow
Both Sass and Less are CSS preprocessors. ... A CSS preprocessor is basically a scripting languag...