gumby_on_rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/app/assets/javascripts/gumby/libs/extensions/gumby.comments.js +152 -0
  5. data/app/assets/javascripts/gumby/libs/extensions/gumby.fittext.js +126 -0
  6. data/app/assets/javascripts/gumby/libs/extensions/gumby.images.js +202 -0
  7. data/app/assets/javascripts/gumby/libs/extensions/gumby.inview.js +219 -0
  8. data/app/assets/javascripts/gumby/libs/extensions/gumby.parallax.js +106 -0
  9. data/app/assets/javascripts/gumby/libs/extensions/gumby.shuffle.js +198 -0
  10. data/app/assets/javascripts/gumby/libs/gumby.init.js +47 -0
  11. data/app/assets/javascripts/gumby/libs/gumby.js +258 -0
  12. data/app/assets/javascripts/gumby/libs/gumby.min.js +1 -0
  13. data/app/assets/javascripts/gumby/libs/jquery-1.10.1.min.js +6 -0
  14. data/app/assets/javascripts/gumby/libs/jquery-1.10.1.min.map +1 -0
  15. data/app/assets/javascripts/gumby/libs/jquery-2.0.2.min.js +6 -0
  16. data/app/assets/javascripts/gumby/libs/jquery-2.0.2.min.map +1 -0
  17. data/app/assets/javascripts/gumby/libs/jquery.mobile.custom.min.js +3 -0
  18. data/app/assets/javascripts/gumby/libs/modernizr-2.6.2.min.js +4 -0
  19. data/app/assets/javascripts/gumby/libs/ui/gumby.checkbox.js +101 -0
  20. data/app/assets/javascripts/gumby/libs/ui/gumby.fixed.js +240 -0
  21. data/app/assets/javascripts/gumby/libs/ui/gumby.navbar.js +115 -0
  22. data/app/assets/javascripts/gumby/libs/ui/gumby.radiobtn.js +90 -0
  23. data/app/assets/javascripts/gumby/libs/ui/gumby.retina.js +81 -0
  24. data/app/assets/javascripts/gumby/libs/ui/gumby.skiplink.js +157 -0
  25. data/app/assets/javascripts/gumby/libs/ui/gumby.tabs.js +80 -0
  26. data/app/assets/javascripts/gumby/libs/ui/gumby.toggleswitch.js +264 -0
  27. data/app/assets/javascripts/gumby/libs/ui/jquery.validation.js +142 -0
  28. data/app/assets/javascripts/gumby/main.js +23 -0
  29. data/app/assets/javascripts/gumby/plugins.js +4 -0
  30. data/app/assets/javascripts/gumby.all.js +19 -0
  31. data/app/assets/javascripts/gumby.js +13 -0
  32. data/app/assets/stylesheets/gumby/_base.scss +49 -0
  33. data/app/assets/stylesheets/gumby/_custom.scss +1 -0
  34. data/app/assets/stylesheets/gumby/_fonts.scss +28 -0
  35. data/app/assets/stylesheets/gumby/_grid.scss +339 -0
  36. data/app/assets/stylesheets/gumby/_parallax.scss +11 -0
  37. data/app/assets/stylesheets/gumby/_shame.scss +36 -0
  38. data/app/assets/stylesheets/gumby/_typography.scss +272 -0
  39. data/app/assets/stylesheets/gumby/extensions/modular-scale/lib/modular-scale.rb +128 -0
  40. data/app/assets/stylesheets/gumby/extensions/modular-scale/stylesheets/_modular-scale.scss +310 -0
  41. data/app/assets/stylesheets/gumby/extensions/sassy-math/lib/sassy-math.rb +159 -0
  42. data/app/assets/stylesheets/gumby/extensions/sassy-math/stylesheets/_math.scss +310 -0
  43. data/app/assets/stylesheets/gumby/functions/_all.scss +25 -0
  44. data/app/assets/stylesheets/gumby/functions/_breakpoints.scss +11 -0
  45. data/app/assets/stylesheets/gumby/functions/_button-size.scss +44 -0
  46. data/app/assets/stylesheets/gumby/functions/_clearfix.scss +25 -0
  47. data/app/assets/stylesheets/gumby/functions/_em.scss +11 -0
  48. data/app/assets/stylesheets/gumby/functions/_even.scss +10 -0
  49. data/app/assets/stylesheets/gumby/functions/_fade.scss +20 -0
  50. data/app/assets/stylesheets/gumby/functions/_fancytiles.scss +29 -0
  51. data/app/assets/stylesheets/gumby/functions/_fixed.scss +21 -0
  52. data/app/assets/stylesheets/gumby/functions/_forms.scss +18 -0
  53. data/app/assets/stylesheets/gumby/functions/_grid-calc.scss +82 -0
  54. data/app/assets/stylesheets/gumby/functions/_height-calc.scss +6 -0
  55. data/app/assets/stylesheets/gumby/functions/_icons.scss +35 -0
  56. data/app/assets/stylesheets/gumby/functions/_line-and-height.scss +7 -0
  57. data/app/assets/stylesheets/gumby/functions/_palette.scss +76 -0
  58. data/app/assets/stylesheets/gumby/functions/_responsivity.scss +34 -0
  59. data/app/assets/stylesheets/gumby/functions/_semantic-grid.scss +170 -0
  60. data/app/assets/stylesheets/gumby/functions/_shapes.scss +22 -0
  61. data/app/assets/stylesheets/gumby/functions/_strip-units.scss +5 -0
  62. data/app/assets/stylesheets/gumby/functions/_tooltips.scss +98 -0
  63. data/app/assets/stylesheets/gumby/functions/_typography.scss +15 -0
  64. data/app/assets/stylesheets/gumby/functions/_visibility.scss +17 -0
  65. data/app/assets/stylesheets/gumby/gumby.scss +39 -0
  66. data/app/assets/stylesheets/gumby/ui/_all.scss +11 -0
  67. data/app/assets/stylesheets/gumby/ui/_buttons.scss +154 -0
  68. data/app/assets/stylesheets/gumby/ui/_forms.scss +392 -0
  69. data/app/assets/stylesheets/gumby/ui/_icons.scss +23 -0
  70. data/app/assets/stylesheets/gumby/ui/_images.scss +23 -0
  71. data/app/assets/stylesheets/gumby/ui/_labels.scss +87 -0
  72. data/app/assets/stylesheets/gumby/ui/_navbar.scss +440 -0
  73. data/app/assets/stylesheets/gumby/ui/_tables.scss +89 -0
  74. data/app/assets/stylesheets/gumby/ui/_tabs.scss +156 -0
  75. data/app/assets/stylesheets/gumby/ui/_toggles.scss +73 -0
  76. data/app/assets/stylesheets/gumby/ui/_tooltips.scss +12 -0
  77. data/app/assets/stylesheets/gumby/ui/_video.scss +24 -0
  78. data/app/assets/stylesheets/gumby/var/_lists.scss +20 -0
  79. data/app/assets/stylesheets/gumby/var/_settings.scss +169 -0
  80. data/app/assets/stylesheets/gumby/var/icons/_entypo-icon-list.scss +286 -0
  81. data/app/assets/stylesheets/gumby/var/icons/_entypo.scss +294 -0
  82. data/app/assets/stylesheets/gumby.all.css.scss +20 -0
  83. data/app/assets/stylesheets/gumby.css.scss +37 -0
  84. data/app/controllers/gumby/application_controller.rb +4 -0
  85. data/app/helpers/gumby/application_helper.rb +4 -0
  86. data/app/views/layouts/gumby/application.html.erb +14 -0
  87. data/config/routes.rb +2 -0
  88. data/lib/gumby/engine.rb +10 -0
  89. data/lib/gumby/version.rb +3 -0
  90. data/lib/gumby.rb +4 -0
  91. data/lib/tasks/gumby_tasks.rake +20 -0
  92. data/public/fonts/gumby/icons/entypo.eot +0 -0
  93. data/public/fonts/gumby/icons/entypo.ttf +0 -0
  94. data/public/fonts/gumby/icons/entypo.woff +0 -0
  95. metadata +235 -0
@@ -0,0 +1,310 @@
1
+ // SASSY MATH
2
+
3
+ @charset "UTF-8";
4
+
5
+ //////////////////////////////
6
+ // Variables
7
+ //////////////////////////////
8
+ $pi: 3.1415926535897932384626433832795028841971693993751;
9
+ $π: $pi;
10
+ $e: 2.71828182845904523536028747135266249775724709369995;
11
+
12
+ $iter: 50;
13
+
14
+ //////////////////////////////
15
+ // Random Number
16
+ // Working from http://xkcd.com/221/
17
+ // Chosen by fair dice roll.
18
+ // Guarenteed to be random.
19
+ //////////////////////////////
20
+ @function rand() {
21
+ @return 4;
22
+ }
23
+
24
+ //////////////////////////////
25
+ // Percent
26
+ //////////////////////////////
27
+ @function percent($number) {
28
+ @return $number * 0.01;
29
+ }
30
+
31
+ //////////////////////////////
32
+ // Exponent
33
+ //////////////////////////////
34
+ @function exponent($base, $exponent) {
35
+ // reset value
36
+ $value: $base;
37
+ // positive intergers get multiplied
38
+ @if $exponent > 1 {
39
+ @for $i from 2 through $exponent {
40
+ $value: $value * $base; } }
41
+ // negitive intergers get divided. A number divided by itself is 1
42
+ @if $exponent < 1 {
43
+ @for $i from 0 through -$exponent {
44
+ $value: $value / $base; } }
45
+ // return the last value written
46
+ @return $value;
47
+ }
48
+
49
+ @function pow($base, $exponent) {
50
+ @return exponent($base, $exponent);
51
+ }
52
+
53
+ //////////////////////////////
54
+ // Factorial
55
+ //////////////////////////////
56
+ @function factorial($number) {
57
+ // reset value
58
+ $value: 1;
59
+ // positive intergers get multiplied
60
+ @if $number > 0 {
61
+ @for $i from 1 through $number {
62
+ $value: $value * $i;
63
+ }
64
+ }
65
+ @return $value;
66
+ }
67
+
68
+ @function fact($number) {
69
+ @return factorial($number);
70
+ }
71
+
72
+
73
+ //////////////////////////////
74
+ // Polynomial Approximation
75
+ //////////////////////////////
76
+ // Maclaurin series can be used to estimate Sine and Consine
77
+ @function maclaurin($start, $key, $number) {
78
+ $value: $start;
79
+ $add: 0;
80
+
81
+ @for $i from 1 through $iter {
82
+ @if $add == 0 {
83
+ $value: $value - ( exponent($number, $key) / factorial($key) );
84
+ $add: 1;
85
+ }
86
+ @else {
87
+ $value: $value + ( exponent($number, $key) / factorial($key) );
88
+ $add: 0;
89
+ }
90
+
91
+ $key: $key + 2;
92
+ }
93
+
94
+ @return $value;
95
+ }
96
+ // Taylor series can be used to estiamte ln
97
+ @function taylor($number) {
98
+ @return taylor;
99
+ }
100
+
101
+ //////////////////////////////
102
+ // Basic Trig Functions
103
+ //////////////////////////////
104
+ // Bundled in Compass: http://compass-style.org/reference/compass/helpers/trig/
105
+ // References for implementing using MacLaurin series below:
106
+
107
+ //@function sin($number, $unit: 'deg') {
108
+ // @if $unit == 'deg' {
109
+ // $number: deg-to-rad($number);
110
+ // }
111
+ // @return maclaurin($number, 3, $number);
112
+ //}
113
+ //
114
+ //@function cos($number, $unit: 'deg') {
115
+ // @if $unit == 'deg' {
116
+ // $number: deg-to-rad($number);
117
+ // }
118
+ // @return maclaurin(1, 2, $number);
119
+ //}
120
+ //
121
+ //// Trig Identity: Tangent = Sine divided by Cosine.
122
+ //@function tan($number, $unit: 'deg') {
123
+ // @if $unit == 'deg' {
124
+ // $number: deg-to-rad($number);
125
+ // }
126
+ // @return sin($number) / cos($number);
127
+ //}
128
+
129
+ //////////////////////////////
130
+ // Reciprocal Trig Functions
131
+ //////////////////////////////
132
+ @function csc($number, $unit: 'deg') {
133
+ @if $unit == 'deg' {
134
+ $number: deg-to-rad($number);
135
+ }
136
+ @return 1 / sin($number);
137
+ }
138
+
139
+ @function scs($number, $unit: 'deg') {
140
+ @if $unit == 'deg' {
141
+ $number: deg-to-rad($number);
142
+ }
143
+ @return 1 / cos($number);
144
+ }
145
+
146
+ @function cot($number, $unit: 'deg') {
147
+ @if $unit == 'deg' {
148
+ $number: deg-to-rad($number);
149
+ }
150
+ @return 1 / tan($number);
151
+ }
152
+
153
+ //////////////////////////////
154
+ // Hyperbolic Functions
155
+ //////////////////////////////
156
+ @function sinh($number) {
157
+ $top: exponent($e, (2 * $number)) - 1;
158
+ $bottom: 2 * exponent($e, $number);
159
+ @return $top / $bottom;
160
+ }
161
+
162
+ @function cosh($number) {
163
+ $top: exponent($e, (2 * $number)) + 1;
164
+ $bottom: 2 * exponent($e, $number);
165
+ @return $top / $bottom;
166
+ }
167
+
168
+ @function tanh($number) {
169
+ $top: exponent($e, (2 * $number)) - 1;
170
+ $bottom: exponent($e, (2 * $number)) + 1;
171
+ @return $top / $bottom;
172
+ }
173
+
174
+ //////////////////////////////
175
+ // Reciprocal Hyperbolic Functions
176
+ //////////////////////////////
177
+ @function csch($number) {
178
+ @return 1 / sinh($number);
179
+ }
180
+
181
+ @function sech($number) {
182
+ @return 1 / cosh($number);
183
+ }
184
+
185
+ @function coth($number) {
186
+ @return 1/ tanh($number);
187
+ }
188
+
189
+
190
+ @function log($number) {
191
+ @return $number;
192
+ }
193
+
194
+ @function ln($number) {
195
+ @if $number > 0 and $number < 1 {
196
+ $value: 0;
197
+ @for $i from 1 through $iter {
198
+ $value: $value + ( pow(-1, $i) * pow(-1 * (1 - $number), $i)) / $i;
199
+ }
200
+ $value: -1 * $value;
201
+
202
+ @return $value;
203
+ }
204
+ @else if $number == 1 {
205
+ @return 0;
206
+ }
207
+ @else {
208
+ @return ERROR;
209
+ @warn ln input must be greater than zero and less than or equal to 1;
210
+ }
211
+ }
212
+
213
+
214
+ //////////////////////////////
215
+ // Degree/Radian Conversion
216
+ //////////////////////////////
217
+ @function deg-to-rad($number) {
218
+ @return $number * $pi / 180deg;
219
+ }
220
+
221
+ @function rad-to-deg($number) {
222
+ @return $number * 180deg / $pi;
223
+ }
224
+
225
+ //////////////////////////////
226
+ // Root Functions
227
+ //////////////////////////////
228
+ // Basic General-Purpose Root Function
229
+ @function n-root($number, $n) {
230
+ @if $number < 1 {
231
+ @return ERROR;
232
+ @warn ROOT ERROR;
233
+ }
234
+ // If a whole number, generate it quickly
235
+ @for $i from 1 through $number {
236
+ @if exponent($i, $n) == $number {
237
+ @return $i;
238
+ }
239
+ }
240
+ // Else, run through other options
241
+ @for $i from 1 through $number * 1000 / 2 {
242
+ @if round(exponent($i / 1000, $n) * 100) == round($number * 100) {
243
+ @return $i / 1000;
244
+ }
245
+ }
246
+ }
247
+
248
+ @function root($number, $n) {
249
+ @return n-root($number, $n);
250
+ }
251
+
252
+ // Square Roots
253
+ @function √($number) {
254
+ @return sqrt($number);
255
+ }
256
+
257
+ @function sqrt($number) {
258
+ $guess: rand();
259
+ $root: $guess;
260
+ @for $i from 1 through $iter {
261
+ $root: $root - (pow($root, 2) - $number) / (2 * $root);
262
+ }
263
+ @return $root;
264
+ }
265
+
266
+ //////////////////////////////
267
+ // Golden Ratio
268
+ //////////////////////////////
269
+ @function golden() {
270
+ @return 1/2 + sqrt(5) / 2;
271
+ }
272
+ @function ϕ() {
273
+ @return golden();
274
+ }
275
+
276
+ $golden-ratio: golden();
277
+ $ϕ: $golden-ratio;
278
+
279
+ //////////////////////////////
280
+ // Is Int and Is Float
281
+ //////////////////////////////
282
+ @function is-int($number) {
283
+ @if type-of($number) != 'number' {
284
+ @warn '#{$number} is not a number! It cannot be an integer if it is not a number!';
285
+ @return false;
286
+ }
287
+ @if $number - floor($number) != 0 {
288
+ @return false;
289
+ }
290
+ @else {
291
+ @return true;
292
+ }
293
+ }
294
+
295
+ @function is-float($number) {
296
+ @if type-of($number) != 'number' {
297
+ @warn '#{$number} is not a number! It cannot be an decimal if it is not a number!';
298
+ @return false;
299
+ }
300
+ @if $number - floor($number) != 0 {
301
+ @return true;
302
+ }
303
+ @else {
304
+ @return false;
305
+ }
306
+ }
307
+
308
+ @function is-decimal($number) {
309
+ @return is-float($number);
310
+ }
@@ -0,0 +1,25 @@
1
+ // Global Gumby Functions
2
+
3
+ @import "breakpoints";
4
+ @import "strip-units";
5
+ @import "grid-calc";
6
+ @import "height-calc";
7
+ @import "em";
8
+ @import "even";
9
+
10
+ // Global Gumby Mixins
11
+
12
+ @import "clearfix";
13
+ @import "typography";
14
+ @import "fixed";
15
+ @import "palette";
16
+ @import "shapes";
17
+ @import "palette";
18
+ @import "fade";
19
+ @import "responsivity";
20
+ @import "line-and-height";
21
+ @import "semantic-grid";
22
+ @import "tooltips";
23
+ @import "visibility";
24
+ @import "fancytiles";
25
+ @import "icons";
@@ -0,0 +1,11 @@
1
+ @function breakpoint($breakpoint) {
2
+ @if $breakpoint == $document-width {
3
+ @return $document-width - 1;
4
+ }
5
+ @if $breakpoint == $tablet-device-width {
6
+ @return $tablet-device-width - 1;
7
+ }
8
+ @if $breakpoint == $min-device-width {
9
+ @return $min-device-width + 1;
10
+ }
11
+ }
@@ -0,0 +1,44 @@
1
+ @mixin button-size($size) {
2
+ $n: 0;
3
+ @if $size == xlarge {
4
+ $n: $xlarge-button-font-size;
5
+ }
6
+ @if $size == large {
7
+ $n: $large-button-font-size;
8
+ }
9
+ @if $size == medium {
10
+ $n: $medium-button-font-size;
11
+ }
12
+ @if $size == small {
13
+ $n: $small-button-font-size;
14
+ }
15
+ $button-font-size: $n;
16
+ $button-height: ms($ratio, $button-font-size) + 1;
17
+ $line-height: $button-height - 2;
18
+
19
+ @include font-size($button-font-size);
20
+ @include line-and-height($button-height);
21
+
22
+ a {
23
+ position:relative;
24
+ padding: 0 ms(0, $button-font-size);
25
+ }
26
+
27
+ &.icon-left {
28
+ a {
29
+ padding-left: $button-height;
30
+ &:before {
31
+ left: $button-font-size / 1.5;
32
+ }
33
+ }
34
+ }
35
+
36
+ &.icon-right {
37
+ a {
38
+ padding-right: $button-height;
39
+ &:after {
40
+ right: $button-font-size / 1.5;
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,25 @@
1
+ @mixin clearfix() {
2
+ *zoom:1;
3
+ &:before, &:after {
4
+ content: "";
5
+ display: table;
6
+ }
7
+ &:after {
8
+ clear: both;
9
+ }
10
+ }
11
+
12
+ @mixin mobilefix() {
13
+ @include respond(all-phones) {
14
+ &:before, &:after {
15
+ content: " ";
16
+ display: table;
17
+ }
18
+ &:after {
19
+ clear: both;
20
+ }
21
+ &:last-child {
22
+ float: none;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,11 @@
1
+ // Convert pixels to ems
2
+
3
+ @function em($size-in-px, $context: 16) {
4
+ @if not unitless($size-in-px) {
5
+ $size-in-px: strip-units($size-in-px);
6
+ }
7
+ @if not unitless($context) {
8
+ $context: strip-units($context);
9
+ }
10
+ @return ($size-in-px / $context) * 1em;
11
+ }
@@ -0,0 +1,10 @@
1
+ // test for even numbers, do something with the result
2
+
3
+ @function even($number) {
4
+ @if ($number % 2 == 0) {
5
+ @return true;
6
+ }
7
+ @else {
8
+ @return false;
9
+ }
10
+ }
@@ -0,0 +1,20 @@
1
+ // Fade Mixin
2
+
3
+ $fade-duration: .6s;
4
+
5
+ @mixin fade($direction: out, $duration: $fade-duration) {
6
+
7
+ @if $direction != out {
8
+ visibility: visible;
9
+ @include opacity(1);
10
+ }
11
+
12
+ @else {
13
+ visibility: hidden;
14
+ @include opacity(0);
15
+ }
16
+
17
+ @include transition-property(opacity);
18
+ @include transition-duration($fade-duration);
19
+
20
+ }
@@ -0,0 +1,29 @@
1
+ @function divide-cols($colnum) {
2
+ @return 100%/$colnum;
3
+ }
4
+
5
+
6
+ @mixin fancytiles($desktop-columns, $tablet-columns: $desktop-columns, $mobile-columns: 1, $small-break: 0px, $medium-break: $tablet-device-width, $large-break: $row-max-width) {
7
+
8
+ // These styles apply to all shift-columns
9
+ display: inline-block;
10
+ float: left;
11
+ padding-left: $gutter / 2;
12
+ padding-right: $gutter / 2;
13
+
14
+ // IE8 fallback
15
+ width: divide-cols($mobile-columns);
16
+
17
+ @include respond("min-width: #{$small-break}") {
18
+ width: divide-cols($mobile-columns);
19
+ }
20
+
21
+ @include respond("min-width: #{$medium-break}") {
22
+ width: divide-cols($tablet-columns);
23
+ }
24
+
25
+ @include respond("min-width: #{$large-break}") {
26
+ width: divide-cols($desktop-columns);
27
+ }
28
+
29
+ }
@@ -0,0 +1,21 @@
1
+ @mixin fixed($removal-breakpoint) {
2
+ .fixed {
3
+ position: fixed;
4
+ &.pinned {
5
+ position: absolute;
6
+ }
7
+ @if $removal-breakpoint != false {
8
+ @include respond($removal-breakpoint) {
9
+ position: relative !important;
10
+ top: auto !important;
11
+ left: auto !important;
12
+ }
13
+ }
14
+ }
15
+
16
+ .unfixed {
17
+ position: relative !important;
18
+ top: auto !important;
19
+ left: auto !important;
20
+ }
21
+ }
@@ -0,0 +1,18 @@
1
+ @mixin input-size($size) {
2
+ @if $size == xxwide { $size: 100%; }
3
+ @if $size == xwide { $size: 82.6666666667%; }
4
+ @if $size == wide { $size: 65.3333333333%; }
5
+ @if $size == normal { $size: 48%; }
6
+ @if $size == narrow { $size: 30.6666666667%; }
7
+ @if $size == xnarrow { $size: 13.3333333333%; }
8
+
9
+ width: $size;
10
+ }
11
+
12
+ @mixin input-sizes-list() {
13
+ $sizes: ();
14
+ @each $item in $field-sizes {
15
+ $sizes: join($sizes, unquote(".#{$item} "), comma);
16
+ }
17
+ #{$sizes} { @content }
18
+ }
@@ -0,0 +1,82 @@
1
+ // Calculate grid values
2
+ $gutter: percentage($gutter-in-px / $row-max-width); // 2.1276596
3
+
4
+ // Return single column width
5
+ @function oneCol($hybrid-grid: false) {
6
+ @if ($hybrid-grid == true){
7
+ @return (100% - ($gutter * ($hybrid - 1))) / $hybrid;
8
+ }
9
+ @else{
10
+ @return (100% - ($gutter * ($cols - 1))) / $cols;
11
+ }
12
+ }
13
+
14
+ // Calculate Grid Column Widths
15
+ @function columns($num, $hybrid-grid: false){
16
+ @if ($hybrid-grid == true) {
17
+ @return (oneCol(true) * $num) + ($gutter * ($num - 1));
18
+ }
19
+ @else {
20
+ @return (oneCol() * $num) + ($gutter * ($num - 1)); // (One column * 'x') + (gutter * ('x' - 1)) = Column Width
21
+ }
22
+ }
23
+
24
+
25
+ // Calculate the width required to acheive a desired global column number within a nested grid
26
+ @function global-columns($desired_cols, $container_cols, $hybrid-grid: false){
27
+ @if ($hybrid-grid == true) {
28
+ @return (100% * (columns($desired_cols, true) / columns($container_cols, true)));
29
+ }
30
+ @else {
31
+ @return (100% * (columns($desired_cols) / columns($container_cols)));
32
+ }
33
+ }
34
+
35
+ // Calculate Push Class Margins
36
+ @function push_x($num, $first-child: false, $is-hybrid: false) {
37
+ @if $first-child and $is-hybrid {
38
+ @return (oneCol(true) * $num) + ($gutter * ($num - 1)) + $gutter; // Column width + gutter
39
+ }
40
+ @else if $first-child != true and $is_hybrid{
41
+ @return (oneCol(true) * $num) + ($gutter * ($num - 1)) + ($gutter * 2); // Column width + (gutter * 2)
42
+ }
43
+ @else if $first-child and $is_hybrid != true{
44
+ @return (oneCol() * $num) + ($gutter * ($num - 1)) + $gutter;
45
+ }
46
+ @else {
47
+ @return (oneCol() * $num) + ($gutter * ($num - 1)) + ($gutter * 2); // Column width + (gutter * 2)
48
+ }
49
+ }
50
+
51
+ // Calculate Pull Class Margins
52
+ // note absence of first-child; first-child column containers should not be pulled
53
+ // $num is number of columns to be pulled
54
+ // $width is number of columns of container that is being pulled
55
+ @function pull_x($num, $width, $is-hybrid: false) {
56
+ @if $is-hybrid {
57
+ @return -((oneCol(true) * $num) + ($gutter * ($num - 1)) + (oneCol(true) * $width) + ($gutter * ($width - 1)) + $gutter); // Pull width + column width + gutter
58
+ }
59
+ @else {
60
+ @return -((oneCol() * $num) + ($gutter * ($num - 1)) + (oneCol() * $width) + ($gutter * ($width - 1)) + $gutter); // Pull width + column width + gutter
61
+ }
62
+ }
63
+
64
+ // Calculate Centered Class Margins
65
+ @function centered($num, $hybrid-grid: false) {
66
+ @if $hybrid-grid{
67
+ @return 50% - ((($num * (oneCol(true))) + (($num - 1) * $gutter)) / 2);
68
+ }
69
+ @else{
70
+ @return 50% - ((($num * (oneCol())) + (($num - 1) * $gutter)) / 2);
71
+ }
72
+ }
73
+
74
+ // Create class names from column count integers
75
+ @function number-as-word($number){
76
+ $w: "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven",
77
+ "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen",
78
+ "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven",
79
+ "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three",
80
+ "thirty-four", "thirty-five", "thirty-six";
81
+ @return nth($w, $number);
82
+ }
@@ -0,0 +1,6 @@
1
+
2
+ // Calculate the height of an object based on its scale
3
+
4
+ @function height-calc($size) {
5
+ @return ms($ratio, $size) + 1;
6
+ }
@@ -0,0 +1,35 @@
1
+ @function match($list, $icon) {
2
+ @each $item in $list {
3
+ $index: index($item, $icon);
4
+ @if $index {
5
+ $return: if($index == 1, 2, $index);
6
+ @return nth($item, $return);
7
+ }
8
+ }
9
+ @return false;
10
+ }
11
+
12
+ @mixin i($icon) {
13
+ .#{$icon}.icon-left a:before,
14
+ .#{$icon}.icon-right a:after,
15
+ i.#{$icon}:before {
16
+ content: "#{match($entypo-icons, $icon)}";
17
+ height: inherit;
18
+ }
19
+ }
20
+
21
+ @mixin icon($icon) {
22
+ @if (type-of($icon) == list) {
23
+ @each $i in $icon {
24
+ @include i($i);
25
+ }
26
+ }
27
+ @elseif ($icon == all) {
28
+ @each $icon in $entypo-icons {
29
+ @include i(nth($icon, 1));
30
+ }
31
+ }
32
+ @else {
33
+ @include i($icon);
34
+ }
35
+ }
@@ -0,0 +1,7 @@
1
+
2
+ // Make line-height equal to an element's height
3
+
4
+ @mixin line-and-height($height) {
5
+ height: $height;
6
+ line-height: $height - 2;
7
+ }