This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_tools.mixins.scss
89 lines (72 loc) · 1.77 KB
/
_tools.mixins.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// Tools: Mixins
// ---
// Global mixins
//
// Calculate text-color based on background-color
@mixin text-color($c1) {
// Calculations based on https://vimeo.com/60224584
@if (.2126*red($c1) + .7152*green($c1) + .0722*blue($c1))/255 <= .5 {
color: mix(#FFF, $c1, 95%);
} @else {
color: mix(#000, $c1, 70%);
}
}
// UI mixins.
// Cross browser background opacity.
@mixin background-opacity($color, $alpha) {
$rgba: rgba($color, $alpha);
$ie-hex-str: ie-hex-str($rgba);
background-color: $rgba;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str},endColorstr=#{$ie-hex-str});
zoom: 1;
}
//
// Media Query mixin
// @include mq(#point, #query1, #query2);
//
@mixin mq($breakpoint, $query1: min, $query2: width) {
$query: map-get($breakpoints, $breakpoint);
@if $query != null {
@media (#{$query1}-#{$query2}: #{$query}) {
@content;
}
} @else {
@media (#{$query1}-#{$query2}: $breakpoint) {
@content;
}
}
}
// Vertically center any object within its container. Works in IE9 and up.
// @include vertical-center;
@mixin vertical-center {
position: relative;
top: 50%;
transform: translateY(-50%);
}
// Clearfix.
// @mixin clearfix
@mixin clearfix {
*zoom: 1;
&:before,
&:after {
display: table;
content: '';
}
&:after {
clear: both;
}
}
// Prevent Long URL’s From Breaking Out of Container.
// http://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container
@mixin word-break {
word-break: break-all;
hyphens: auto;
}
@mixin hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}