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 trialConnor Toth
7,335 PointsHow is sass more efficient (more dry) than css if it just gets outputted to the same "wet" css code?
Does not the browser have to load the same repetitive css? I guess I don't understand how, once the website is finished and the files are uploaded to the hosting server, Sass getting outputted to CSS works exactly.
4 Answers
Layne Benofsky
6,914 PointsMy take would be that the "dry" aspect has to do with the coding and development process for the humans, rather than the output code for the browsers to use. Until they can process things like Sass natively, there will always be long repetitions of style statements, etc.
It's also far easier to maintain. Maybe that's the most important part. :)
Ryan Carson
23,287 PointsHi Connor
Great question. The answer is that the output is the same, but there's a drastic difference in the .scss file. You only have to type something once in the .scss file and it will output multiple times in the css. The DRY ("Don't Repeat Yourself") principle applies to the code you're writing in the .scss file, not the outputted .css file.
Thanks for being a Treehouse Student!
Cheers, Ryan
Connor Toth
7,335 PointsOk so, the DRY aspect of using Sass is for our sake, the developer's sake, and has nothing to do with actually making the load time any shorter by using less code on the Sass side.
Ok thanks for clearing that up!
-connor
Guil Hernandez
Treehouse TeacherHi Connor Toth,
Also, if you want to learn how to write Sass that outputs "DRY" CSS, take a look at our new course: Modular CSS with Sass. :)
Connor Toth
7,335 PointsConnor Toth
7,335 PointsIs there any word on CSS being updated, so that it includes code/fixes provided by using Sass?