Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Sass, Real World example

I kind of get what Sass is, but could someone explain a real world example of how you would use it?

4 Answers

Andre' Jones
Andre' Jones
26,671 Points

Sass is CSS just with built in features to make writing it faster. Im not sure what u mean by real world example, but its just CSS. Example - Zurb Foundation is a CSS framework built on SASS. Learn CSS write it alot of it then learn Sass and u'll appreciate what it offers.

oh okay, thank you, I Thought it was a separate thing, like you would have a CSS file and a Sass file

Andre' Jones
Andre' Jones
26,671 Points

nah once u write sass it will be compiled and it will turn into scss automagically

Andre' Jones
Andre' Jones
26,671 Points

once u write sass it will turn into css automagically

thanks!

In my opinion, sass is a more usable tool, as it has a more conventional approach for a developper. CSS is quite time-eater, where sass can re-use your previous code, nest, write functions and variables, etc... It can become quite handy, especially if you are familiar with other codes. Plain CSS is still usable, that's why it's quite confortable for beginners. (sorry for my english, not my mother tongue).

Thank you Giovanni!

You're welcome :). A simple example I could give you, is to create a navbar, a responsive one :). Do it with a pure css code, and then try it with Sass, and then with Foundation (you can learn from the new Framework basics course), it uses Sass (or if you prefer Less, you can use Bootstrap, which is also taught in the Framework basics course). It's a perfect (and easier) way to see what you can do with Sass, a lot quicker than with pure CSS. Give us a reply when you do, we can learn from your experience ^^.

Thank you Giovanni, I will once Im ready to get to that! thanks again!