-
Notifications
You must be signed in to change notification settings - Fork 3
/
_mixin.scss
56 lines (50 loc) · 1.66 KB
/
_mixin.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@mixin responsive-property($key, $property, $important: false) {
$map: get($key);
@if type-of($map) != map {
#{$property}: $map #{if($important, "!important", "")};
} @else {
@each $bp, $value in $map {
$value: if(is-lazy($value), exec-lazy($value), $value);
@if $bp == "all" {
#{$property}: $value #{if($important, "!important", "")};
} @else {
@include breakpoint(get("breakpoint/#{$bp}")) {
#{$property}: $value #{if($important, "!important", "")};
}
}
}
}
}
// A clearfix mixin that just implements (Nicolas Gallagher's micro clearfix)
// [http://nicolasgallagher.com/micro-clearfix-hack/].
//
// We have to define our own since both
// (Bourbon)[http://bourbon.io/docs/#clearfix] and
// (Scut)[http://davidtheclark.github.io/scut/#clearfix] use a different
// clearfix solution that didn't work for us.
@mixin clearfix() {
//
// For modern browsers
// 1. The space content is one way to avoid an Opera bug when the
// contenteditable attribute is included anywhere else in the document.
// Otherwise it causes space to appear at the top and bottom of elements
// that are clearfixed.
// 2. The use of `table` rather than `block` is only necessary if using
// `:before` to contain the top-margins of child elements.
//
&:before,
&:after {
content: " "; // 1
display: table; // 2
}
&:after {
clear: both;
}
//
// For IE 6/7 only
// Include this rule to trigger hasLayout and contain floats.
//
& {
*zoom: 1;
}
}