-
Notifications
You must be signed in to change notification settings - Fork 0
/
_utility.scss
125 lines (104 loc) · 2.55 KB
/
_utility.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
120
121
122
123
124
/**
* Utility Mixins
* =================================
* - clearfix
* - font-face
* - sizing shortcuts
* - size
* - square
* - resizable
*/
// Clearfix
// http://www.cssmojo.com/latest_new_clearfix_so_far/
// Other ko-clearfix options: https://github.com/stubbornella/oocss/blob/master/oocss/src/components/utils/_clearfix-me.scss
@mixin ko-clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
// @font-face
// @include ko-font-face(proxima-nova, /css/fonts/proxima-nova, normal, italic, false);
@mixin ko-font-face($family-name, $font-path, $font-weight: normal, $font-style: normal) {
@font-face {
font-family: $family-name;
src: url('#{$font-path}.eot');
src: url('#{$font-path}.eot?#iefix') format('embedded-opentype'),
url('#{$font-path}.woff') format('woff'),
url('#{$font-path}.ttf') format('truetype'),
url('#{$font-path}.svg##{$family-name}') format('svg');
font-weight: $font-weight;
font-style: $font-style;
}
}
// Centre-align a block level element
// @include ko-center-block
@mixin ko-center-block() {
display: block;
margin: 0 auto;
}
// Input placeholder text
@mixin ko-placeholder($color: lighten(#000, 70%)) {
:-ms-input-placeholder {
color: $color;
}
:-moz-placeholder {
color: $color;
}
::-webkit-input-placeholder {
color: $color;
}
}
// Text selection
@mixin ko-text-selection($color-selection, $color-selection-bg) {
::-moz-selection {
color: $color-selection;
background: $color-selection-bg;
text-shadow: none;
}
::selection {
color: $color-selection;
background: $color-selection-bg;
text-shadow: none;
}
}
// Vertical align
// @include ko-vertical-align(50px);
@mixin ko-vertical-align($argument) {
line-height: $argument;
height: $argument;
}
// Text truncation
// @include ko-truncate(300px);
// @include ko-truncate(100%);
@mixin ko-truncate($truncation-boundary) {
max-width: $truncation-boundary;
@include ko-text-overflow();
}
// Text overflow
// @include ko-text-overflow();
// Requires inline-block or block for proper styling
@mixin ko-text-overflow {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/**
* Sizing shortcuts
*/
// @include ko-size(10px, 30px);
@mixin ko-size($width: 5px, $height: 5px) {
height: $height;
width: $width;
}
// @include ko-square(50px);
@mixin ko-square($size: 5px) {
@include ko-size($size, $size);
}
// Make any element resizable for prototyping
// @include ko-resizable();
@mixin ko-resizable($direction: both) {
resize: $direction; // Options are horizontal, vertical, both
overflow: auto; // Safari fix
}