If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2016
    Member #
    1 times

    Why use SASS/ LESS?

    Why use SASS/ LESS?
    I get the idea, to make CSS smaller, etc. But do I really need to make CSS use functions, and variables? And if I'm writing large SASSS/LESS files, why not just write a CSS file?
    I believe I've got the idea, but I want some other opinions/ clarifications. Thanks


  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Oklahoma City
    Member #
    959 times
    I personally like variables, mixins and nesting.

    Variables are nice for the same reason they are in other languages. You change a value in one place, and it permeates through the whole body of code.

    Mixins, which are kind of like functions, allow me to write one line of CSS that outputs an entire set of properties. One that I use pretty regularly is a clearfix mixin. When you float elements, as you probably know, it causes their container to collapse. To correct that, people use a clearfix. A lot of people use a clearfix element, but I use the after pseudo-element. It requires more lines of CSS, but keeps style separate from structure, as it's meant to be.
    So, I have this mixin defined:
    @mixin clearfix{
      content: '';
      display: block;
      height: 0;
      width: 0;
      clear: both;
    Then, in the rest of my SCSS:
      /* some css */
        @include clearfix;
        float: left;
    Finally, nesting. I really don't know how better to describe it, except that nesting just feels like how CSS should have been designed from the beginning.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Junior Member
    Join Date
    Jun 2017
    Member #
    1 times

    I wrote an article about advantages and usage of LESS. You can check it, maybe it'll be useful for you:

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 03:54 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: