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 trialBradley Hapgood
Python Development Techdegree Student 10,854 PointsSass Maps
So, I'm having trouble understanding this.
So, if it's less than 'sm' $break it'll apply the 'xs' breakpoint.
But it's it's greater than 'sm' will it just apply the 'med' or will it instinctively know to apply the 'lg' $break. Or would I have to apply that logic to the mixin?
1 Answer
Matthew Whittle
6,656 PointsYou're still passing the $break to the mixin from the previous videos, so the function is aware of whether this is applying to a xs, sm, med, or lg screen. In this lesson, the variables at the top are using that value to pull back a number from the map. Once the number values are returned, the if-statement is then checking whether the statement is less than the value returned by 'sm'.
essentially in pseudo-code: if the value returned is less than small return the media query with max-width of the value else (you don't have to write this in the code, but if all other situations: greater than or equal to small) return the media query with min-width of the value