-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrwdcss.scss
40 lines (35 loc) · 927 Bytes
/
rwdcss.scss
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
@mixin rwd( $names: (), $outputContent: true) {
$rwdcss-options: (
prefix: "---MQ"
);
// Check if there are custom options set
@if global-variable-exists(rwdcss) {
// Merge them with the defaults
$rwdcss-options: map_merge($rwdcss-options, $rwdcss);
}
@if $outputContent {
@content;
}
$prefix: map-get($rwdcss-options, prefix);
@each $name in $names {
@each $bp in $breakpoints {
@if nth($bp,1) == $name {
&#{$prefix}#{nth($bp, 1)} {
@if mixin-exists(media) {
@include media( nth($bp, 2) ) {
@content;
}
}
@else if mixin-exists(breakpoint) {
@include breakpoint( nth($bp, 2) ) {
@content;
}
}
@else {
@error "No media query mixin detected. Please use Bourbon Neat or Breakpoint.";
}
}
}
}
}
}