Should I use CSS Preprocessors?

Over the past few years in web development circles, we have seen several frameworks both for front-end development and server side development released. Without doubt, many developers will agree that these frameworks have immensely increased development speed for projects and made life much easier for us.

 

Recently, I began  looking  into css preprocessors particularly Sass. After spending some time getting to grips with the concepts of the language, the question came to me “Should i use css preprocessors in my future projects” ?. I have a feeling several developers may have asked themselves these questions too. So based on my findings regarding Sass, I intend to evaluate Sass as a css preprocessor as a way of determining if it is worth using in your next project.

As programmers and developers, we like to think in terms of variables, operators and functions when writing code and as much as possible would like to stay within this mind-frame in all or most of our projects.

 

We know that traditional css is not really a programming language that allows you write code in that mind-frame that keeps developers sweet. Thanks to css preprocessor languages you can now write css using conventional programming practices such as functions called mixins and re-use them whenever, declare variables and use operators to perform arithmetic operations on your css properties values.

 

Css preprocessor languages allow you write css code in the preprocessor language which is compiled into native css by the preprocessor compiler installed on your machine. To use css preprocessors you have to first install the compiler of your css preprocessor of choice unto your machine.

 

These compilers can be installed via the command line or using GUI applications. The leading css preprocessors are LESS and Sass. Of the two my favorite is Sass. This is a personal choice as I have found Sass to be much more active in its development.

 

Ok! Enough of the story get to the point already. Why should i use css preprocessors. I have put together 7 points that show the advantages of using css preprocessors.

  • helps you write css in a programming context
  • you can easily change css properties of several elements in one swoop
  • saves development time
  • allows you write complex css with simple to understand syntax
  • contains out of the box functions to enable to you perform amazing css manipulations
  • you can import external css files into one single css file to speed up page load time.
  • lets you create re-usable css functions.

 

Should you decide to go the css preprocessor route someday I suggest using Sass. I know you want to know why i have suggested Sass but that explanation is outside the scope of this post.

Check out this Beginner Sass tutorial below. I found it on youtube and thought someone might find it useful. I hope it convinces you to try out Sass.


Happy coding!.

Share this: