summaryrefslogtreecommitdiff
blob: 80cf50f5e2956931f9b5044ccee07ac53c58ad15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// ==========================================================================
// Breakpoint Mixin
//
// Uses Sass Maps which requires Sass v3.3.0 or newer
//
//
// EXAMPLE
//
// body {
// 	@include breakpoint(tablet){
// 		font-size: 14px;
// 	};
// }

// ==========================================================================

// Add or remove breakpoints as you desire
$breakpoints:(
	phone: 320px,
	large-phone: 530px,
	phablet: 600px,
	tablet: 782px,
	desktop: 900px,
	large-desktop: 1147px,
);

@mixin breakpoint($size){
	@each $breakpoint, $value in $breakpoints {
		@if $size == $breakpoint {
			@media (max-width: map-get($breakpoints, $breakpoint)){
				@content;
			}
		}
	}
}

// For mobile first
@mixin minbreakpoint($size){
	@each $breakpoint, $value in $breakpoints {
		@if $size == $breakpoint {
			@media (min-width: map-get($breakpoints, $breakpoint)){
				@content;
			}
		}
	}
}