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 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

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

1 Answer

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