/
mixins.scss
119 lines (108 loc) · 3.59 KB
/
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@import "variables";
@mixin leftInnerShadow {
box-shadow: 0.8em 0.8em 1.6em $shadowColor;
}
@mixin embedded {
max-width: 100%;
}
@mixin gradientFromLeft {
background: $gradientColorStart; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjZGZkZmYyIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iNzklIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-linear-gradient(-45deg, $gradientColorStart 0%, rgba(255, 255, 255, 0) 79%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%, $gradientColorStart), color-stop(79%, rgba(255, 255, 255, 0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, $gradientColorStart 0%, rgba(255, 255, 255, 0) 79%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, $gradientColorStart 0%, rgba(255, 255, 255, 0) 79%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, $gradientColorStart 0%, rgba(255, 255, 255, 0) 79%); /* IE10+ */
background: linear-gradient(135deg, $gradientColorStart 0%, rgba(255, 255, 255, 0) 79%); /* W3C */
}
@mixin horizTrans {
transition: width $transitionDuration ease;
}
@mixin bottomInnerShadow() {
box-shadow: 0 0.5em 1em -0.1em $shadowColor;
}
@mixin headerBackground() {
background: $headerFromColor; /* for non-css3 browsers */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$header-from-color', endColorstr='$header-to-color', GradientType=1); /* for IE */
background: linear-gradient(left top, $headerFromColor, $headerToColor);
}
@mixin ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@mixin hovered($paddingY: $selectionPaddingY) {
border: none;
border-radius: $borderRadius;
background: rgba(184, 197, 212, 0.49);
transition: background 0.2s ease-out;
}
.hovered {
@include hovered();
}
@mixin selectable() {
cursor: pointer;
padding: $selectionPaddingY $selectionPaddingX;
margin: (-$selectionPaddingY) (-$selectionPaddingX);
&:hover {
@include hovered();
}
}
@mixin menu {
display: block;
position: relative;
overflow: auto; // Allow menu to scroll if too long
padding: 0;
// transition: height $transitionDuration ease;
@include headerBackground();
li {
display: block;
a {
display: block;
}
h1 {
padding: 0;
margin: 0;
}
h2 {
background: none;
margin: 0;
padding: 0;
width: auto;
}
h3 {
margin: 0;
padding: 0;
width: auto;
}
h4 {
margin: 0;
padding: 0;
width: auto;
}
padding: $selectionPaddingY $selectionPaddingX;
float: none;
&:focus {
color: #FFF;
background-color: $hoverColor;
text-decoration: none;
cursor: pointer;
}
}
}
@mixin dropdownMenu {
li {
width: 100%;
}
@include menu();
position: absolute;
@include bottomInnerShadow;
height: 0; // Closed by default
}
@mixin embeddedMenu {
@include menu();
position: relative;
height: auto;
box-shadow: none;
}