Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Sass/Scss

So I have a question for anyone who can answer.

I am starting the CSS to Sass portion of the track (Almost done with the track) and I am at the part where we are discussing placeholders and I could not help but notice that it seemed a lot like we were trying to provide some object orientation to web design and creation.

Am I in the ballpark or totally wrong?

2 Answers

Matthew Brock
Matthew Brock
16,791 Points

Placeholder selectors in sass is a way of reusing code (i.e. DRY). It is so you can write as set of (property: values;) pairs once and reuse them over an over again with out retyping them. They are close to parameterless mixins.

Jordan Watson
Jordan Watson
14,738 Points

Sass provides a number of different ways to share code between CSS rules. You can use mixins to insert new CSS properties and/or rules into your CSS and you can use @extend to share CSS properties between selectors @extend generate more efficient output. So extending placeholders tends to be a cleaner way of reusing CSS Making it an awesome way to make your code as dry as possible!