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 Basics Add Reusable Logic to Your Sass Storing Values in Maps

GoldSpec Digital
GoldSpec Digital
4,185 Points

Sass Maps

So after watching this video, I just feel like it overly complicated media queries and it seems a bit redundant in this example.

Does anyone have any real world examples of when they use Sass maps and how they make code cleaner and more efficient?

Christopher Gardner
Christopher Gardner
12,719 Points

Sass Maps aren't media queries at all. Whereas media queries are for helping you change layout/style at different breakpoints in the browser sass maps has a completely different function. For example, you could use a sass map to store data that you want to create classes from using functions.

https://teamtreehouse.com/library/loop-through-data-in-a-map-with-each

Christopher Gardner
Christopher Gardner
12,719 Points

You're close to the video I just posted so it will make a little more sense soon! Cheers and happy coding!