www.webdeveloper.com
Results 1 to 2 of 2

Thread: Sass and Scss

  1. #1
    Join Date
    Jan 2007
    Posts
    110

    Sass and Scss

    Hi, I just started reading on Sass and Scss. I am not sure about a few things.

    1. My understanding is in order to use Sass or Scss, first I need to write a .sass or .scss file,
    then use ruby to compile it into a css file, it's not something like I would do in the html file to link to and external css file, and it not compiled in real time when the web page is loading. eg. In the <head> section, I would do this:
    <link rel="stylesheet" type="text/css" href="style.css" />
    but I would not write
    <link rel="stylesheet" type="text/css" href="style.scss" /> or <link rel="stylesheet" type="text/css" href="style.sass" />
    am I right?

    2. With sass or scss does it mean that in can keep updating style.css using ruby while the web site is live?

    3. In what circumstance would I use Sass orScss instead of just plain old css?

    4. Does the server, the host must have ruby installed?

    5. The only different between sass and scss is that sass and scss file are identical except sass does not have the {} braces, right?

    Thank you anyone for clear up my confusions.
    Last edited by MacPC; 02-25-2013 at 02:16 PM.

  2. #2
    Join Date
    Feb 2013
    Posts
    9
    1. That is correct. SASS/SCSS need to be compiled into CSS. Your HTML file uses the CSS file.
    2. Depending on how you've set things up, you can have Ruby recompile on each request. However, this is not advised on a production server as it eats CPU cycles. It is better to precompile your SASS/SCSS files into CSS and host only your CSS files on the production server. This will speed things up.
    3. SASS/SCSS is great in keeping your styles DRY (Don't Repeat Yourself). The benefits of DRY are many, but a few that stand out here are smaller files to look at which helps maintainability and ease of update since you would make a lot of things a variable, like colours or font-size. You only need to change the variables in one place. If you get more advanced, you get have mixins that can be reused, like rounded corners or drop shadows. If you want to see the full power of SASS/SCSS in action, check out the Compass framework at compass-style.org (sorry, I can't post URLs yet).
    4. The server does not need to have Ruby installed if you've already precompiled SASS/SCSS into CSS and are only uploading CSS to your production server.
    5. Correct. And no ; semicolons too. However, I would suggest using SCSS as it is ultimately closer to CSS and easier for other people to understand if they've never seen SASS/SCSS before. Also, I believe the community is leaning towards SCSS more.

    Hope that clears some things up!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles