ultimate-base 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +5 -0
  2. data/.rvmrc +2 -0
  3. data/.rvmrc.example +2 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +14 -0
  6. data/LICENSE +5 -0
  7. data/README.md +1 -0
  8. data/Rakefile +1 -0
  9. data/app/assets/javascripts/backbone/backbone.js +1452 -0
  10. data/app/assets/javascripts/backbone/ultimate/app.js.coffee +25 -0
  11. data/app/assets/javascripts/backbone/ultimate/collection.js.coffee +12 -0
  12. data/app/assets/javascripts/backbone/ultimate/model.js.coffee +12 -0
  13. data/app/assets/javascripts/backbone/ultimate/router.js.coffee +13 -0
  14. data/app/assets/javascripts/backbone/ultimate/view.js.coffee +96 -0
  15. data/app/assets/javascripts/ultimate/base.js.coffee +103 -0
  16. data/app/assets/javascripts/ultimate/bus.js.coffee +57 -0
  17. data/app/assets/javascripts/ultimate/devise.js.coffee +18 -0
  18. data/app/assets/javascripts/ultimate/experimental/_inflections/dzone.inflections.js +154 -0
  19. data/app/assets/javascripts/ultimate/experimental/_inflections/inflections.js.coffee +2 -0
  20. data/app/assets/javascripts/ultimate/experimental/_inflections/plur.js +29 -0
  21. data/app/assets/javascripts/ultimate/experimental/_inflections/underscore.inflection.js +175 -0
  22. data/app/assets/javascripts/ultimate/experimental/fuzzy-json-generator.js.coffee +48 -0
  23. data/app/assets/javascripts/ultimate/helpers/array.js.coffee +63 -0
  24. data/app/assets/javascripts/ultimate/helpers/asset_tag.js.coffee +63 -0
  25. data/app/assets/javascripts/ultimate/helpers/decor.js.coffee +14 -0
  26. data/app/assets/javascripts/ultimate/helpers/forms.js.coffee +0 -0
  27. data/app/assets/javascripts/ultimate/helpers/tags.js.coffee +70 -0
  28. data/app/assets/javascripts/ultimate/helpers.js.coffee +149 -0
  29. data/app/assets/javascripts/ultimate/improves/datepicker.js.coffee +34 -0
  30. data/app/assets/javascripts/ultimate/improves/form-errors.js.coffee +146 -0
  31. data/app/assets/javascripts/ultimate/improves/form.js.coffee +155 -0
  32. data/app/assets/javascripts/ultimate/improves/magic-radios.js.coffee +41 -0
  33. data/app/assets/javascripts/ultimate/improves/tablesorter.js +59 -0
  34. data/app/assets/javascripts/ultimate/improves/typed-field.js.coffee +98 -0
  35. data/app/assets/javascripts/ultimate/underscore/underscore.js +1059 -0
  36. data/app/assets/javascripts/ultimate/underscore/underscore.string.js +480 -0
  37. data/app/assets/javascripts/ultimate/widgets/dock.js.coffee +70 -0
  38. data/app/assets/javascripts/ultimate/widgets/gear.js.coffee +84 -0
  39. data/app/assets/javascripts/ultimate/widgets/jquery-ext.js.coffee +104 -0
  40. data/app/assets/javascripts/ultimate/widgets/jquery.adapter.js.coffee +62 -0
  41. data/app/assets/javascripts/ultimate/widgets/widget.js.coffee +115 -0
  42. data/app/assets/stylesheets/polyfills/PIE.htc +96 -0
  43. data/app/assets/stylesheets/polyfills/boxsizing.htc +300 -0
  44. data/app/assets/stylesheets/ultimate/mixins/_routines.css.scss +95 -0
  45. data/app/assets/stylesheets/ultimate/mixins/_vendors.css.scss +34 -0
  46. data/app/assets/stylesheets/ultimate/mixins/css3/_text-shadow.scss +37 -0
  47. data/app/assets/stylesheets/ultimate/mixins/css3.css.scss +328 -0
  48. data/app/assets/stylesheets/ultimate/mixins/decor.css.scss +86 -0
  49. data/app/assets/stylesheets/ultimate/mixins/fonts.css.scss +100 -0
  50. data/app/assets/stylesheets/ultimate/mixins/microstructures.css.scss +188 -0
  51. data/app/assets/stylesheets/ultimate/structures/slider.css.scss +53 -0
  52. data/lib/ultimate-base/engine.rb +6 -0
  53. data/lib/ultimate-base/extensions/directive_processor.rb +64 -0
  54. data/lib/ultimate-base/extensions/sass_script_functions.rb +39 -0
  55. data/lib/ultimate-base/version.rb +5 -0
  56. data/lib/ultimate-base.rb +10 -0
  57. data/ultimate-base.gemspec +25 -0
  58. metadata +102 -0
@@ -0,0 +1,328 @@
1
+ // Use compatibility tables from http://caniuse.com/
2
+ // http://css3pie.com/documentation/supported-css3-features/#pie-watch-ancestors
3
+ // http://css3pie.com/documentation/supported-css3-features/#pie-lazy-init
4
+ // TODO use !default http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variable_defaults_
5
+
6
+ $support-ie: true !default;
7
+ $pie-url: asset-url("polyfills/PIE.htc", '') !default;
8
+ $boxsizing-url: asset-url("polyfills/boxsizing.htc", '') !default;
9
+
10
+ @mixin pie($poll: none, $watch-ancestors: 0) {
11
+ @if $support-ie and $pie-url {
12
+ behavior: $pie-url;
13
+ // http://css3pie.com/documentation/supported-css3-features/#pie-poll
14
+ @if $poll != none {
15
+ -pie-poll: $poll;
16
+ }
17
+ // http://css3pie.com/documentation/supported-css3-features/#pie-watch-ancestors
18
+ @if $watch-ancestors > 0 {
19
+ -pie-watch-ancestors: $watch-ancestors;
20
+ }
21
+ }
22
+ }
23
+
24
+ @import "ultimate/mixins/vendors";
25
+ @import "ultimate/mixins/routines";
26
+ @import "ultimate/mixins/css3/text-shadow";
27
+
28
+ // Round all corners by a specific amount.
29
+ // example:
30
+ // @include border-radius(5px 5px 0 0);
31
+ // produce:
32
+ // -webkit-border-radius: 5px 5px 0 0; // iOS-Safari <= 3.2, Android <= 2.1
33
+ // border-radius: 5px 5px 0 0;
34
+ @mixin border-radius($params) {
35
+ @include vendors(webkit, border-radius, $params);
36
+ }
37
+
38
+ // Round mentioned corners by a specific amounts without muted corners by none or false.
39
+ // example:
40
+ // @include border-radius__complex(5px 7px none);
41
+ // produce:
42
+ // -webkit-border-top-left-radius: 5px; // iOS-Safari <= 3.2, Android <= 2.1
43
+ // border-top-left-radius: 5px;
44
+ // -webkit-border-top-right-radius: 7px;
45
+ // border-top-right-radius: 7px;
46
+ // -webkit-border-bottom-left-radius: 7px;
47
+ // border-bottom-left-radius: 7px;
48
+ @mixin border-radius_complex($params) {
49
+ @if isset($params) {
50
+ $l: length($params);
51
+ @if $l == 1 or complex-isset($params) {
52
+ @include border-radius($params);
53
+ } @else {
54
+ @if $l < 4 {
55
+ $params: complex-list($params);
56
+ }
57
+ $i: 0;
58
+ @each $corner in top-left, top-right, bottom-right, bottom-left {
59
+ $i: $i + 1;
60
+ $p: nth($params, $i);
61
+ @if isset($p) {
62
+ @include vendors(webkit, border-#{$corner}-radius, $p);
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ // Provide CSS3 box-shadow property.
70
+ // example:
71
+ // @include box-shadow(#00F -10px 0 10px, #F00 10px 0 10px);
72
+ // produce:
73
+ // -webkit-box-shadow: #00F -10px 0 10px, #F00 10px 0 10px; // Safari 5.0, iOS-Safari <= 4.3, Android <= 4.0 missing "inset" and blur radius value support for iOS-Safari <= 3.2, Android <= 3.0
74
+ // box-shadow: #00F -10px 0 10px, #F00 10px 0 10px;
75
+ @mixin box-shadow($shadow0, $shadow1: false, $shadow2: false, $shadow3: false, $shadow4: false, $shadow5: false, $shadow6: false, $shadow7: false, $shadow8: false, $shadow9: false) {
76
+ $shadows: compact-list($shadow0 $shadow1 $shadow2 $shadow3 $shadow4 $shadow5 $shadow6 $shadow7 $shadow8 $shadow9);
77
+ @include vendors(webkit, box-shadow, $shadows);
78
+ }
79
+
80
+ // Change the box model of element.
81
+ // example:
82
+ // @include box-sizing;
83
+ // produce:
84
+ // -webkit-box-sizing: border-box; // Safari <= 5.0, iOS-Safari <= 4.3, Android <= 3.0
85
+ // -moz-box-sizing: border-box; // actual
86
+ // box-sizing: border-box; //
87
+ // *behavior: url("/assets/polyfills/boxsizing.htc"); // IE 6-7
88
+ @mixin box-sizing($params: border-box) {
89
+ @include vendors(webkit moz, box-sizing, $params);
90
+ @if $support-ie and $boxsizing-url {
91
+ // https://github.com/Schepp/box-sizing-polyfill
92
+ *behavior: $boxsizing-url; // IE 6-7
93
+ }
94
+ }
95
+
96
+ // Provide CSS3 linear-gradient as background image.
97
+ // params:
98
+ // $corner:
99
+ // Represents the position of the starting-point of the gradient line.
100
+ // It consists of two keywords: the first one indicates the horizontal side, `left` or `right`,
101
+ // and the second one the vertical side, `top` or `bottom`.
102
+ // The order is not relevant and each of the keyword is optional.
103
+ // The values `to top`, `to bottom`, `to left` and `to right`
104
+ // are translated into the angles `0deg`, `180deg`, `270deg`, `90deg` respectively.
105
+ // The others are translated into an angle that let the starting-point to be in the same quadrant
106
+ // than the described corner and so that the line defined by the starting-point and the corner
107
+ // is perpendicular to the gradient line. That way, the color described by the <color-stop>
108
+ // will exactly apply to the corner point. This is sometimes called the "magic corner" property.
109
+ // The end-point of the gradient line is the symmetrical point of the starting-point
110
+ // on the other direction of the center box.
111
+ // _angle:
112
+ // An angle of direction for the gradient. See <angle> (https://developer.mozilla.org/en/CSS/angle).
113
+ // $stops:
114
+ // This value is comprised of a <color> value, followed by an optional stop position
115
+ // (either a percentage between 0% and 100% or a <length> along the gradient axis).
116
+ // Rendering of color-stops in CSS gradients follows the same rules as color-stops in SVG gradients.
117
+ // example:
118
+ // @include linear-gradient(right, (green, orange 20%, red 100%));
119
+ // produce:
120
+ // background-color: $bg-color;
121
+ // background-image: -webkit-gradient(linear, right top, left top, color-stop(0%, green), color-stop(20%, orange), color-stop(100%, red)); // old webkit (Safari <= 5.0, iOS-Safari <= 4.3, Android <= 3.0)
122
+ // background-image: -webkit-linear-gradient(right, green, orange 20%, red 100%); // Chrome 10+, Safari 5.1+
123
+ // background-image: -moz-linear-gradient(right, green, orange 20%, red 100%); // FF 3.6+
124
+ // background-image: -ms-linear-gradient(right, green, orange 20%, red 100%); // IE 10+
125
+ // background-image: -o-linear-gradient(right, green, orange 20%, red 100%); // Opera 11.1+
126
+ // background-image: linear-gradient(right, green, orange 20%, red 100%); // future
127
+ // -pie-background: $bg-c linear-gradient(right, green, orange 20%, red 100%); // IE 6-9
128
+ @mixin linear-gradient($corner_angle, $stops) {
129
+ $wk_start: left top;
130
+ $wk_end: left bottom;
131
+ $start: nth($corner_angle, 1);
132
+ @if $start == top {
133
+ $wk_start: left top;
134
+ $wk_end: left bottom;
135
+ } @else if $start == bottom {
136
+ $wk_start: left bottom;
137
+ $wk_end: left top;
138
+ } @else if $start == left {
139
+ $wk_start: left top;
140
+ $wk_end: right top;
141
+ } @else if $start == right {
142
+ $wk_start: right top;
143
+ $wk_end: left top;
144
+ }
145
+ $wk_stops: ();
146
+ $stops_length: length($stops);
147
+ $repcents-by-stop: 100 / ($stops_length - 1);
148
+ $i: 0;
149
+ $p: 0;
150
+ @each $stop in $stops {
151
+ $i: $i + 1;
152
+ $cp: "#{$p}%";
153
+ @if length($stop) > 1 {
154
+ $cp: nth($stop, 2);
155
+ }
156
+ $stop: "#{$cp}, #{nth($stop, 1)}";
157
+ $wk_stops: append($wk_stops, color-stop(#{$stop}), comma);
158
+ $p: $p + $repcents-by-stop;
159
+ }
160
+ $bg-color: nth(nth($stops, 1), 1);
161
+ background-color: $bg-color;
162
+ background-image: -webkit-gradient(linear, $wk_start, $wk_end, $wk_stops);
163
+ $linear-gradient: linear-gradient($corner_angle, $stops);
164
+ @include vendors-param(webkit moz ms o, background-image, $linear-gradient);
165
+ @if $support-ie and $pie-url {
166
+ -pie-background: $bg-color $linear-gradient;
167
+ }
168
+ }
169
+
170
+ // Provide CSS3 radial-gradient as background image.
171
+ // params:
172
+ // $position:
173
+ // A position, interpreted in the same way as background-position or transform-origin. If omitted, the default is center.
174
+ // _angle:
175
+ // An angle establishing the gradient line, which extends from the starting point at this angle; this is 0deg by default.
176
+ // $shape:
177
+ // circle Meaning that the gradient's shape is a circle with constant radius.
178
+ // ellipse Meaning that the shape is an axis-aligned ellipse.
179
+ // _size:
180
+ // closest-side The gradient's shape meets the side of the box closest to its center (for circles) or meets both the vertical and horizontal sides closest to the center (for ellipses).
181
+ // closest-corner The gradient's shape is sized so it exactly meets the closest corner of the box from its center.
182
+ // farthest-side Similar to closest-side, except the shape is sized to meet the side of the box farthest from its center (or vertical and horizontal sides).
183
+ // farthest-corner The gradient's shape is sized so it exactly meets the farthest corner of the box from its center.
184
+ // contain A synonym for closest-side.
185
+ // cover A synonym for farthest-corner.
186
+ // example:
187
+ // @include radial-gradient(center 45deg, circle closest-side, (orange 0%, red 100%));
188
+ // produce:
189
+ // background-image: -webkit-radial-gradient(center 45deg, circle closest-side, orange 0%, red 100%); // Chrome 10+, Safari 5.1+
190
+ // background-image: -moz-radial-gradient(center 45deg, circle closest-side, orange 0%, red 100%); // FF 3.6+
191
+ // background-image: -ms-radial-gradient(center 45deg, circle closest-side, orange 0%, red 100%); // IE 10+
192
+ // background-image: -o-radial-gradient(center 45deg, circle closest-side, orange 0%, red 100%); // Opera 11.6+
193
+ // background-image: radial-gradient(center 45deg, circle closest-side, orange 0%, red 100%); // future
194
+ @mixin radial-gradient($position_angle, $shape_size, $stops) {
195
+ // TODO may be deprecate background-image: -webkit-gradient(radial, $wk_start, $wk_end, unquote(list-to-string($wk_stops, ", ")));
196
+ @include vendors-param(webkit moz ms o, background-image, radial-gradient($position_angle, $shape_size, change-separator($stops)));
197
+ }
198
+
199
+ // EXPERIMENTAL
200
+ @mixin border-gradient($color_start, $color_stop, $is_horizontal: false) {
201
+ $start: top;
202
+ $wk_start: left top;
203
+ $wk_stop: left bottom;
204
+ @if $is_horizontal {
205
+ $start: left;
206
+ $wk_stop: right top;
207
+ } @else {
208
+ $start: top;
209
+ $wk_stop: left bottom;
210
+ }
211
+ border-color: $color_start mix($color_start, $color_stop) $color_stop;
212
+ -webkit-border-image: -webkit-gradient(linear, $wk_start, $wk_stop, from($color_start), to($color_stop)); // old webkit (Safari <= 5.0, iOS-Safari <= 4.3, Android <= 3.0)
213
+ // TODO may be new -webkit-gradient?
214
+ -moz-border-image: -moz-linear-gradient($start, $color_start, $color_stop); // FF 3.5+
215
+ -ms-border-image: -ms-linear-gradient($start, $color_start, $color_stop); // IE 10+
216
+ -o-border-image: -o-linear-gradient($start, $color_start, $color_stop); // Opera 11.0+
217
+ border-image: linear-gradient($start, $color_start, $color_stop); // future
218
+ }
219
+
220
+ // Provide cross-browser CSS opacity.
221
+ // example:
222
+ // @include opacity(0.3);
223
+ // produce:
224
+ // opacity: 0.3;
225
+ // filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30); // IE <= 8.0
226
+ @mixin opacity($value: 0.5) {
227
+ opacity: $value;
228
+ @if $support-ie {
229
+ $value: round($value * 100);
230
+ @if $value < 100 {
231
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=#{$value});
232
+ } @else {
233
+ filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
234
+ }
235
+ }
236
+ }
237
+
238
+ // For rgba()
239
+ @mixin pie-bg($bg) {
240
+ background: $bg;
241
+ @if $pie-url {
242
+ -pie-background: $bg;
243
+ }
244
+ }
245
+
246
+ // example:
247
+ // @include ellipsis;
248
+ // produce:
249
+ // overflow: hidden; // need to work text-overflow
250
+ // -o-text-overflow: ellipsis; // Opera Mini and Opera Mobile
251
+ // text-overflow: ellipsis; // all
252
+ @mixin ellipsis($overflow: hidden) {
253
+ @if $overflow != false {
254
+ overflow: $overflow;
255
+ }
256
+ @include vendors(o, text-overflow, ellipsis);
257
+ }
258
+
259
+ // $param: none || text || all || element
260
+ // example:
261
+ // @include user-select;
262
+ // produce:
263
+ // -webkit-user-select: none;
264
+ // -moz-user-select: none;
265
+ // -ms-user-select: none; // IE 10+
266
+ // -o-user-select: none;
267
+ // user-select: none;
268
+ @mixin user-select($param: none) {
269
+ @include vendors(webkit moz ms o, user-select, $param);
270
+ }
271
+
272
+ // Provide vendorized CSS transition.
273
+ // example:
274
+ // @include transition(all, 0.5s);
275
+ // produce:
276
+ // -webkit-transition: all 0.5s ease; // actual
277
+ // -moz-transition: all 0.5s ease; // FF 8+
278
+ // -ms-transition: all 0.5s ease; // IE 10+
279
+ // -o-transition: all 0.5s ease; // Opera 11.6+
280
+ // without:
281
+ // transition: all 0.5s ease; // future
282
+ @mixin transition($what, $time, $method: ease) {
283
+ @include vendors(webkit moz ms o, transition, $what $time $method, false);
284
+ }
285
+
286
+ // Provide vendorized CSS transform.
287
+ // example:
288
+ // @include transform(scale(1.2, 1.2));
289
+ // produce:
290
+ // -webkit-transform: scale(1.2, 1.2); // actual
291
+ // -moz-transform: scale(1.2, 1.2); // actual
292
+ // -ms-transform: scale(1.2, 1.2); // IE 9+
293
+ // -o-transform: scale(1.2, 1.2); // actual
294
+ // without:
295
+ // transform: scale(1.2, 1.2); // future
296
+ @mixin transform($params) {
297
+ @include vendors(webkit moz ms o, transform, $params, false);
298
+ }
299
+
300
+ // Scale an object along the x and y axis. IE < 9 only proportional scale by $scale-x.
301
+ // example:
302
+ // @include scale(1.2);
303
+ // produce:
304
+ // -webkit-transform: scale(1.2, 1.2); // actual
305
+ // -moz-transform: scale(1.2, 1.2); // actual
306
+ // -ms-transform: scale(1.2, 1.2); // IE 9+
307
+ // -o-transform: scale(1.2, 1.2); // actual
308
+ // *zoom: 1.2; // IE 5.5-7
309
+ // zoom: 1.2\0/; // IE 8
310
+ // without:
311
+ // transform: scale(1.2, 1.2); // future
312
+ @mixin scale($scale-x, $scale-y: $scale-x) {
313
+ @include transform(scale($scale-x, $scale-y));
314
+ @if $support-ie {
315
+ *zoom: $scale-x;
316
+ //zoom: hack-ie8($scale-x); TODO temp!
317
+ }
318
+ }
319
+
320
+ // TODO
321
+ //@mixin placeholder($params) {
322
+ // &::-webkit-input-placeholder, &:-moz-placeholder {
323
+ // #{$params};
324
+ // }
325
+ //}
326
+ //input::-webkit-input-placeholder { color: #a3a3a3 !important;}
327
+ //input:-moz-placeholder { color: #a3a3a3 !important; }
328
+
@@ -0,0 +1,86 @@
1
+ @mixin g-decor_state($offset, $sprite-offset, $state-index: 1) {
2
+ $state-offset: $offset + $sprite-offset * 3 * $state-index;
3
+ > .fill {
4
+ background-position: center (0 - $state-offset) !important;
5
+ }
6
+ > .left {
7
+ background-position: left (0 - $state-offset - $sprite-offset) !important;
8
+ }
9
+ > .right {
10
+ background-position: right (0 - $state-offset - $sprite-offset * 2) !important;
11
+ }
12
+ }
13
+
14
+ @mixin g-decor_type($texture, $offset, $sprite-offset, $decor_width: false) {
15
+ @if $decor_width {
16
+ padding: 0 $decor_width;
17
+ > .left, > .right {
18
+ width: $decor_width + 1 !important;
19
+ }
20
+ }
21
+ > .fill, > .left, > .right {
22
+ background-image: image-url("#{$texture}") !important;
23
+ }
24
+ @include g_decor_state($offset, $sprite-offset, 0);
25
+ }
26
+
27
+ @mixin g-decor($decor_width, $texture: false, $offset: 0, $sprite-offset: 0, $height: false) {
28
+ position: relative;
29
+ white-space: nowrap;
30
+ @if $height {
31
+ height: $height;
32
+ }
33
+ > .fill {
34
+ display: block;
35
+ position: relative;
36
+ height: 100%;
37
+ }
38
+ > .left, > .right {
39
+ display: block;
40
+ height: 100%;
41
+ position: absolute;
42
+ top: 0;
43
+ }
44
+ @if $texture {
45
+ @include g_decor_type($texture, $offset, $sprite-offset, $decor_width);
46
+ }
47
+ > .left {
48
+ left: 0;
49
+ }
50
+ > .right {
51
+ right: 0;
52
+ }
53
+ }
54
+
55
+
56
+
57
+ @mixin g-star-decor_state($sprite-offset, $state) {
58
+ $offset_top: 0 - ($state * $sprite-offset * 2);
59
+ $offset_bottom: $offset_top - $sprite-offset;
60
+ > .corner {
61
+ &.left.top { background-position: right $offset_bottom; }
62
+ &.right.top { background-position: left $offset_bottom; }
63
+ &.left.bottom { background-position: right $offset_top; }
64
+ &.right.bottom { background-position: left $offset_top; }
65
+ }
66
+ }
67
+
68
+ @mixin g-star-decor($texture, $size, $sprite-offset, $state: 0) {
69
+ > .corner {
70
+ width: $size;
71
+ height: $size;
72
+ position: absolute;
73
+ background: image-url("#{$texture}") no-repeat;
74
+ &.left { left: 0; }
75
+ &.right { right: 0; }
76
+ &.top {
77
+ top: 0;
78
+ *top: 1px;
79
+ }
80
+ &.bottom {
81
+ bottom: 0;
82
+ *bottom: 1px;
83
+ }
84
+ }
85
+ @include g-star-decor_state($sprite-offset, $state);
86
+ }
@@ -0,0 +1,100 @@
1
+ // === overloadable in base.scss settings =========
2
+
3
+ $font-family_base: Tahoma, Verdana, sans-serif;
4
+ $font-size_base: 11px;
5
+ $font-family_custom: "PFDinTextCondProThin", Tahoma, Arial, Verdana, sans-serif;
6
+ $font-family_custom_bold: "PFDinTextCondProRegular", Verdana, sans-serif;
7
+ // DEPRECATED:
8
+ $line-height-addition_base: 3px;
9
+ $font-family_accident: "PFDinTextCondProThin", Tahoma, Arial, Verdana, sans-serif;
10
+ $font-family_accident_bold: "PFDinTextCondProRegular", Verdana, sans-serif;
11
+
12
+
13
+ @mixin font-face($family, $url-without-ext, $font-weight: normal, $font-style: normal) {
14
+ @font-face {
15
+ font-family: "#{$family}";
16
+ src: font-url("#{$url-without-ext}.eot");
17
+ src: font-url("#{$url-without-ext}.eot?#iefix") format("embedded-opentype"),
18
+ font-url("#{$url-without-ext}.woff") format("woff"),
19
+ font-url("#{$url-without-ext}.ttf") format("truetype"),
20
+ font-url("#{$url-without-ext}.svg##{$family}") format("svg");
21
+ font-weight: $font-weight;
22
+ font-style: $font-style;
23
+ }
24
+ }
25
+
26
+ @mixin font($font-family, $font-size: false, $line-height: false) {
27
+ font-family: $font-family;
28
+ @if $font-size {
29
+ font-size: $font-size;
30
+ }
31
+ @if $line-height {
32
+ line-height: $line-height;
33
+ }
34
+ }
35
+
36
+ @mixin g-font_base($font-size: $font-size_base, $line-height: false) {
37
+ @include deprecate("g-font_base", "font_base");
38
+ font-family: $font-family_base;
39
+ @if $font-size {
40
+ font-size: $font-size;
41
+ }
42
+ @if $line-height {
43
+ line-height: $line-height;
44
+ } @else {
45
+ @if $font-size {
46
+ line-height: $font-size + $line-height-addition_base;
47
+ }
48
+ }
49
+ }
50
+
51
+ @mixin font_base($font-size: $font-size_base, $line-height: false) {
52
+ @include font($font-family_base, $font-size, $line-height);
53
+ }
54
+
55
+ @mixin font_custom($font-size: false, $line-height: false, $font-family: $font-family_custom) {
56
+ font-weight: normal;
57
+ font-style: normal;
58
+ @include font($font-family, $font-size, $line-height);
59
+ }
60
+
61
+ // TODO http://paulirish.com/2010/font-face-gotchas/
62
+ // TODO -webkit-font-smoothing: antialiased; /* This needs to be set or some font faced fonts look bold on Mac. */
63
+ @mixin g-font_accident_bold($font-size: false, $line-height: false) {
64
+ @include deprecate("g-font_accident_bold", "font_custom");
65
+ font-family: $font-family_accident_bold;
66
+ font-weight: normal;
67
+ font-style: normal;
68
+ @if $font-size {
69
+ font-size: $font-size;
70
+ }
71
+ @if $line-height {
72
+ line-height: $line-height;
73
+ } @else {
74
+ @if $font-size {
75
+ line-height: $font-size + $line-height-addition_base;
76
+ }
77
+ }
78
+ }
79
+
80
+ @mixin g-font_accident($font-size: false, $line-height: false) {
81
+ @include deprecate("g-font_accident", "font_custom");
82
+ font-family: $font-family_accident;
83
+ font-weight: normal;
84
+ font-style: normal;
85
+ @if $font-size {
86
+ font-size: $font-size;
87
+ }
88
+ @if $line-height {
89
+ line-height: $line-height;
90
+ } @else {
91
+ @if $font-size {
92
+ line-height: $font-size + $line-height-addition_base;
93
+ }
94
+ }
95
+ @if $font-family_accident_bold {
96
+ .bold {
97
+ @include g-font_accident_bold;
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,188 @@
1
+ @import "ultimate/mixins/routines";
2
+
3
+ $support-ie: true !default;
4
+
5
+ // example:
6
+ // @include complex-padding(10px 20px none);
7
+ // same:
8
+ // padding: {
9
+ // top: 10px;
10
+ // right: 20px;
11
+ // left: 20px;
12
+ // }
13
+ // produce:
14
+ // padding-top: 10px;
15
+ // padding-right: 20px;
16
+ // padding-left: 20px;
17
+ @mixin complex-padding($params) {
18
+ $params: complex-list($params);
19
+ @include complex-property(padding, $params);
20
+ }
21
+
22
+ // Provide complex box metrics.
23
+ // example:
24
+ // @include box(400px, none, 10px 20px none, 0 auto);
25
+ // produce:
26
+ // padding-top: 10px;
27
+ // padding-right: 20px;
28
+ // padding-left: 20px;
29
+ // margin: 0 auto;
30
+ // width: 360px;
31
+ // TODO border as 2px solid black
32
+ @mixin box($width,
33
+ $height : false,
34
+ $padding : false,
35
+ $margin : false,
36
+ $border : false,
37
+ $include-padding : true,
38
+ $include-margin : false,
39
+ $include-border : true) {
40
+ $properties: $padding $margin $border;
41
+ $include-properties: $include-padding $include-margin $include-border;
42
+ $i: 0;
43
+ @each $property-name in padding, margin, border {
44
+ $i: $i + 1;
45
+ $property: nth($properties, $i);
46
+ @if $property {
47
+ $complex: false;
48
+ @if nth($include-properties, $i) and $property {
49
+ $complex: complex-list($property);
50
+ @if isset($width) {
51
+ $width: $width - nth($complex, 2) - nth($complex, 4);
52
+ }
53
+ @if isset($height) {
54
+ $height: $height - nth($complex, 1) - nth($complex, 3);
55
+ }
56
+ }
57
+ @include complex-property($property-name, $property, $complex);
58
+ }
59
+ }
60
+ @if isset($width) {
61
+ width: $width;
62
+ }
63
+ @if isset($height) {
64
+ height: $height;
65
+ }
66
+ }
67
+
68
+ // Set to container includes float blocks.
69
+ @mixin g-line {
70
+ @include deprecate("@include g-line;", "overflow: hidden;");
71
+ @if $support-ie {
72
+ *zoom: 1;
73
+ _height: 0;
74
+ }
75
+ &:after {
76
+ content: " ";
77
+ display: block;
78
+ clear: both;
79
+ height: 0;
80
+ }
81
+ }
82
+
83
+ // Set to element which disappear after animation in IE6-7.
84
+ @mixin fix-disapp {
85
+ @include deprecate("@include fix-disapp;");
86
+ *overflow: hidden;
87
+ _zoom: 1;
88
+ }
89
+
90
+ // Provides a cross-browser method to implement `display: inline-block;`
91
+ // example:
92
+ // @include inline-block(80px, 20px);
93
+ // produce:
94
+ // display: inline-block;
95
+ // *display: inline;
96
+ // *zoom: 1;
97
+ // width: 80px;
98
+ // height: 20px;
99
+ // vertical-align: middle;
100
+ @mixin inline-block($width: false, $height: false, $vertical-align: middle) {
101
+ display: inline-block;
102
+ @if $support-ie {
103
+ *display: inline;
104
+ *zoom: 1;
105
+ }
106
+ @if $width != none and $width != false {
107
+ width: $width;
108
+ }
109
+ @if $height != none and $height != false {
110
+ height: $height;
111
+ }
112
+ @if $vertical-align != none and $vertical-align != false {
113
+ vertical-align: $vertical-align;
114
+ }
115
+ }
116
+
117
+ @mixin g-justify($item: unquote(".item")) {
118
+ text-align: justify;
119
+ @if $support-ie {
120
+ text-justify: newspaper;
121
+ text-align-last: justify;
122
+ }
123
+ font-size: 2px;
124
+ line-height: 0;
125
+ > #{$item}, &:after {
126
+ @include inline-block;
127
+ text-align: left;
128
+ }
129
+ &:after {
130
+ content: "";
131
+ height: 0;
132
+ width: 99%;
133
+ }
134
+ }
135
+
136
+ @mixin inline-block-list($item: "li") {
137
+ position: relative;
138
+ list-style: none;
139
+ margin: 0;
140
+ padding: 0;
141
+ #{$item} {
142
+ @include inline-block;
143
+ }
144
+ }
145
+
146
+ @mixin block-list($item: "li") {
147
+ overflow: hidden; // @include g-line;
148
+ position: relative;
149
+ list-style: none;
150
+ margin: 0;
151
+ padding: 0;
152
+ #{$item} {
153
+ display: block;
154
+ position: relative;
155
+ float: left;
156
+ }
157
+ }
158
+
159
+ @mixin simple-block-list($item: "li") {
160
+ position: relative;
161
+ list-style: none;
162
+ margin: 0;
163
+ padding: 0;
164
+ #{$item} {
165
+ display: block;
166
+ position: relative;
167
+ }
168
+ }
169
+
170
+ @mixin sticky-footer($layout-padding-bottom, $footer-selector: ".l-page__footer", $layout-selector: ".l-page") {
171
+ html {
172
+ height: 100%;
173
+ }
174
+ body {
175
+ position: relative;
176
+ min-height: 100%;
177
+ }
178
+ #{$layout-selector} {
179
+ position: static;
180
+ padding-bottom: $layout-padding-bottom;
181
+ #{$footer-selector} {
182
+ position: absolute;
183
+ bottom: 0;
184
+ left: 0;
185
+ width: 100%;
186
+ }
187
+ }
188
+ }