edge_framework 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +15 -0
  2. data/.gitattributes +22 -0
  3. data/.gitignore +243 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +38 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +33 -0
  8. data/Rakefile +7 -0
  9. data/assets/js/edge/edge.collect.js +57 -0
  10. data/assets/js/edge/edge.handlebars.js +7 -0
  11. data/assets/js/edge/edge.ie8.js +24 -0
  12. data/assets/js/edge/edge.notification.js +0 -0
  13. data/assets/js/edge/layout.js +10 -0
  14. data/assets/js/edge/prototype.js +6 -0
  15. data/assets/js/edge.js +233 -0
  16. data/assets/js/edge.min.js +1 -0
  17. data/assets/sass/edge/_base.scss +295 -0
  18. data/assets/sass/edge/_components.scss +9 -0
  19. data/assets/sass/edge/_helpers.scss +2 -0
  20. data/assets/sass/edge/components/_block_grid.scss +99 -0
  21. data/assets/sass/edge/components/_form.scss +15 -0
  22. data/assets/sass/edge/components/_grid.scss +301 -0
  23. data/assets/sass/edge/components/_main.scss +133 -0
  24. data/assets/sass/edge/components/_normalize.scss +49 -0
  25. data/assets/sass/edge/components/_palette.scss +24 -0
  26. data/assets/sass/edge/components/_print.scss +71 -0
  27. data/assets/sass/edge/components/_typography.scss +4 -0
  28. data/assets/sass/edge/components/_visibility.scss +64 -0
  29. data/assets/sass/edge/helpers/_sprites.scss +82 -0
  30. data/assets/sass/edge/helpers/_sticky-footer.scss +41 -0
  31. data/assets/sass/edge.scss +9 -0
  32. data/bin/edge +13 -0
  33. data/edge.gemspec +26 -0
  34. data/lib/edge/console.rb +10 -0
  35. data/lib/edge/engine.rb +16 -0
  36. data/lib/edge/version.rb +3 -0
  37. data/lib/edge_framework.rb +22 -0
  38. data/site/Gemfile +4 -0
  39. data/site/assets/css/app.css +24 -0
  40. data/site/assets/css/edge.css +423 -0
  41. data/site/assets/css/normalize.min.css +51 -0
  42. data/site/assets/css/sh/shCoreDefault.css +328 -0
  43. data/site/assets/img/dummy/001.jpg +0 -0
  44. data/site/assets/img/dummy/002.jpg +0 -0
  45. data/site/assets/img/dummy/003.jpg +0 -0
  46. data/site/assets/img/dummy/004.jpg +0 -0
  47. data/site/assets/img/dummy/005.jpg +0 -0
  48. data/site/assets/img/dummy/006.jpg +0 -0
  49. data/site/assets/img/dummy/007.jpg +0 -0
  50. data/site/assets/img/dummy/008.jpg +0 -0
  51. data/site/assets/img/dummy/009.jpg +0 -0
  52. data/site/assets/img/dummy/025.jpg +0 -0
  53. data/site/assets/img/favicon-big.png +0 -0
  54. data/site/assets/img/favicon.png +0 -0
  55. data/site/assets/img/icons/bulbasaur.png +0 -0
  56. data/site/assets/img/icons/charizard.png +0 -0
  57. data/site/assets/img/icons/charmander.png +0 -0
  58. data/site/assets/img/icons/charmeleon.png +0 -0
  59. data/site/assets/img/icons/ivysaur.png +0 -0
  60. data/site/assets/img/icons/squirtle.png +0 -0
  61. data/site/assets/img/icons/venusaur.png +0 -0
  62. data/site/assets/img/icons-se85c66def2.png +0 -0
  63. data/site/assets/img/icons@2x/bulbasaur.png +0 -0
  64. data/site/assets/img/icons@2x/charizard.png +0 -0
  65. data/site/assets/img/icons@2x/charmander.png +0 -0
  66. data/site/assets/img/icons@2x/charmeleon.png +0 -0
  67. data/site/assets/img/icons@2x/ivysaur.png +0 -0
  68. data/site/assets/img/icons@2x/squirtle.png +0 -0
  69. data/site/assets/img/icons@2x/venusaur.png +0 -0
  70. data/site/assets/img/icons@2x-sf605bc03f7.png +0 -0
  71. data/site/assets/js/app.js +0 -0
  72. data/site/assets/js/sh/shBrushCss.js +91 -0
  73. data/site/assets/js/sh/shBrushJScript.js +52 -0
  74. data/site/assets/js/sh/shBrushPhp.js +88 -0
  75. data/site/assets/js/sh/shBrushRuby.js +55 -0
  76. data/site/assets/js/sh/shBrushSass.js +94 -0
  77. data/site/assets/js/sh/shCore.js +17 -0
  78. data/site/assets/js/vendor/custom.modernizr.js +4 -0
  79. data/site/assets/js/vendor/handlebars.js +2239 -0
  80. data/site/assets/js/vendor/handlebars.min.js +2 -0
  81. data/site/assets/js/vendor/jquery.js +6 -0
  82. data/site/assets/sass/_setting.scss +50 -0
  83. data/site/assets/sass/app.scss +52 -0
  84. data/site/assets/sass/edge.scss +3 -0
  85. data/site/config.rb +23 -0
  86. data/site/config.ru +12 -0
  87. data/site/start.rb +20 -0
  88. data/site/views/docs/block_grid.erb +36 -0
  89. data/site/views/docs/grid.erb +147 -0
  90. data/site/views/form.html +114 -0
  91. data/site/views/index.erb +10 -0
  92. data/site/views/layout.erb +61 -0
  93. data/site/views/partials/_sidebar.erb +4 -0
  94. data/template/base/assets/img/favicon.ico +0 -0
  95. data/template/base/assets/js/app.js +3 -0
  96. data/template/base/assets/js/vendor/custom.modernizr.js +4 -0
  97. data/template/base/assets/js/vendor/jquery.min.js +6 -0
  98. data/template/base/assets/sass/_setting.scss +50 -0
  99. data/template/base/assets/sass/app.scss +4 -0
  100. data/template/base/assets/sass/edge.scss +3 -0
  101. data/template/base/config.rb +14 -0
  102. data/template/html/index.html +35 -0
  103. data/template/php/index.php +5 -0
  104. data/template/php/partials/_footer.php +15 -0
  105. data/template/php/partials/_header.php +17 -0
  106. metadata +233 -0
data/assets/js/edge.js ADDED
@@ -0,0 +1,233 @@
1
+ /*
2
+ EDGE LIBRARY
3
+ Based on Foundation 4 by ZURB
4
+ */
5
+ var Edge = {};
6
+ var Foundation = {};
7
+
8
+ (function () {
9
+ // Browser Compatibility
10
+ if (!Array.prototype.filter) {
11
+ Array.prototype.filter = function(fun /*, thisp */) {
12
+ "use strict";
13
+
14
+ if (this == null) {
15
+ throw new TypeError();
16
+ }
17
+
18
+ var t = Object(this),
19
+ len = t.length >>> 0;
20
+ if (typeof fun != "function") {
21
+ try {
22
+ throw new TypeError();
23
+ } catch (e) {
24
+ return;
25
+ }
26
+ }
27
+
28
+ var res = [],
29
+ thisp = arguments[1];
30
+ for (var i = 0; i < len; i++) {
31
+ if (i in t) {
32
+ var val = t[i]; // in case `fun` mutates this
33
+ if (fun && fun.call(thisp, val, i, t)) {
34
+ res.push(val);
35
+ }
36
+ }
37
+ }
38
+
39
+ return res;
40
+ };
41
+
42
+ if (!Function.prototype.bind) {
43
+ Function.prototype.bind = function (oThis) {
44
+ if (typeof this !== "function") {
45
+ // closest thing possible to the ECMAScript 5 internal IsCallable function
46
+ throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
47
+ }
48
+
49
+ var aArgs = Array.prototype.slice.call(arguments, 1),
50
+ fToBind = this,
51
+ fNOP = function () {},
52
+ fBound = function () {
53
+ return fToBind.apply(this instanceof fNOP && oThis
54
+ ? this
55
+ : oThis,
56
+ aArgs.concat(Array.prototype.slice.call(arguments)));
57
+ };
58
+
59
+ fNOP.prototype = this.prototype;
60
+ fBound.prototype = new fNOP();
61
+
62
+ return fBound;
63
+ };
64
+ }
65
+ }
66
+ }() );
67
+
68
+ ;(function (window, document, undefined) {
69
+ 'use strict';
70
+
71
+ Edge = {
72
+ name : 'Edge',
73
+ version : '1.0',
74
+ libs : {},
75
+
76
+ init: function( scope, libraries, method, options, response, /* internal */ nc ) {
77
+ var library_arr,
78
+ args = [scope, method, options, response],
79
+ responses = [],
80
+ nc = nc || false;
81
+
82
+ // Disable library error catching,
83
+ // used for development only
84
+ if (nc) this.nc = nc;
85
+
86
+ // Set edge global scope
87
+ this.scope = scope || this.scope;
88
+
89
+ // If calling specific library
90
+ if (libraries && typeof libraries === 'string') {
91
+ // If calling `off`
92
+ if (/off/i.test(libraries) ) {
93
+ return this.off();
94
+ }
95
+
96
+ library_arr = libraries.split(' ');
97
+
98
+ // If more than 0
99
+ if (library_arr.length) {
100
+ for (var i = 0, len = library_arr.length; i < len; i++) {
101
+ responses.push(this.init_lib(library_arr[i], args) );
102
+ }
103
+ }
104
+ } else {
105
+ for (var lib in this.libs) {
106
+ responses.push(this.init_lib(lib, args) );
107
+ }
108
+ }
109
+ // If first argument is callback, add to args
110
+ if (typeof libraries === 'function') {
111
+ args.unshift(libraries);
112
+ }
113
+
114
+ return this.response_obj(responses, args);
115
+ },
116
+
117
+ response_obj: function( response_arr, args ) {
118
+ for (var callback in args) {
119
+ if (typeof args[callback] === 'function') {
120
+ return args[callback]({
121
+ errors: response_arr.filter(function (s) {
122
+ if (typeof s === 'string') return s;
123
+ })
124
+ });
125
+ }
126
+ }
127
+ console.log(response_arr);
128
+ return response_arr;
129
+ },
130
+
131
+ init_lib: function( lib, args ) {
132
+ return this.trap(function() {
133
+ if (this.libs.hasOwnProperty(lib) ) {
134
+ this.patch(this.libs[lib] );
135
+ return this.libs[lib].init.apply(this.libs[lib], args);
136
+ }
137
+ }.bind(this), lib);
138
+ },
139
+
140
+ // Error Checking
141
+ trap: function( fun, lib ) {
142
+ if (!this.nc) {
143
+ try {
144
+ return fun();
145
+ } catch (e) {
146
+ return this.error({
147
+ name : lib,
148
+ message : 'could not be initialized',
149
+ more : e.name + ' ' + e.message,
150
+ });
151
+ }
152
+ }
153
+ return fun();
154
+ },
155
+
156
+ patch: function( lib ) {
157
+ lib.outerHeight = function (el, bool) {
158
+ if (typeof bool !== 'undefined') {
159
+ return el.outerHeight(bool);
160
+ }
161
+ return el.outerHeight();
162
+ };
163
+
164
+ lib.outerWidth = function (el) {
165
+ if (typeof bool !== 'undefined') {
166
+ return el.outerWidth(bool);
167
+ }
168
+ return el.outerWidth();
169
+ };
170
+ },
171
+
172
+ inherit: function( scope, methods ) {
173
+ console.log('inherit');
174
+ var methods_arr = methods.split(' ');
175
+
176
+ for (var i = methods_arr.length - 1; i >= 0; i--) {
177
+ if (this.lib_methods.hasOwnProperty(methods_arr[i]) ) {
178
+ this.libs[scope.name][methods_arr[i] ] = this.lib_methods[methods_arr[i] ];
179
+ }
180
+ }
181
+ },
182
+
183
+ // Inherited methods in library
184
+ lib_methods: {
185
+ delay: function ( fun, delay ) {
186
+ return setTimeout(fun, delay);
187
+ },
188
+ scrollTo: function ( el, to, duration ) {
189
+ if (duration < 0) return;
190
+ var difference = to - $(window).scrollTop();
191
+ var perTick = difference / duration * 10;
192
+
193
+ this.scrollToTimerCache = setTimeout(function() {
194
+ if (!isNaN(parseInt(perTick, 10) ) ) {
195
+ window.scrollTo(0, $(window).scrollTop() + perTick);
196
+ this.scrollTo(el, to, duration - 10);
197
+ }
198
+ }.bind(this), 10);
199
+ },
200
+
201
+ // Test for empty object or array
202
+ empty : function (obj) {
203
+ if (obj.length && obj.length > 0) { return false; }
204
+ if (obj.length && obj.length === 0) { return true; }
205
+ for (var key in obj) {
206
+ if (hasOwnProperty.call(obj, key) ) { return false; }
207
+ }
208
+ return true;
209
+ },
210
+ },
211
+
212
+ error: function( error ) {
213
+ return error.name + ' ' + error.message + '; ' + error.more;
214
+ },
215
+
216
+ off: function() {
217
+ $(this.scope).off('.edge');
218
+ $(window).off('.edge');
219
+ return true;
220
+ },
221
+ };
222
+
223
+ Foundation = Edge;
224
+
225
+ // JQuery prototype, allow `$().edge()` call
226
+ $.fn.edge = function () {
227
+ var args = Array.prototype.slice.call(arguments, 0);
228
+ return this.each(function () {
229
+ Edge.init.apply(Edge, [this].concat(args) );
230
+ return this;
231
+ });
232
+ };
233
+ }(this, this.document) );
@@ -0,0 +1 @@
1
+ var Edge={};!function(){"use strict";Edge={name:"Edge",version:"1.0",init:function(){},notify:function(i){var n=["<div class='notification'>","<header>",i,"</header>","<span class='close-notification'>&times;</span>","</div>"].join("\n");$("body").append(n)}}}(this,this.document);var h=Edge;
@@ -0,0 +1,295 @@
1
+ // This module must be imported first before other EDGE module
2
+
3
+ @import "compass";
4
+
5
+ // ----------
6
+ // COLOR
7
+ // ----------
8
+ $main-color : #0099CC !default;
9
+ $sub-color : #AAA !default;
10
+ $alert-color : #CC0000 !default;
11
+ $success-color : #3D9900 !default;
12
+
13
+ // ---------------
14
+ // BODY
15
+ // ---------------
16
+ $body-bg : #fff !default;
17
+ $body-font-color : #222 !default;
18
+ $body-font-weight : normal !default;
19
+ $body-font-style : normal !default;
20
+
21
+ $header-font-family : "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
22
+ $body-font-family : "Helvetica", Helvetica, Arial, sans-serif !default;
23
+
24
+ // The default font-size is set to 100% of the browser style sheet (usually 16px)
25
+ // for compatibility with brower-based text zoom or user-set defaults.
26
+ $base-font-size : 100% !default;
27
+
28
+ // ---------------
29
+ // GLOBAL VALUE
30
+ // ---------------
31
+ $g-radius : 5px !default;
32
+ $g-round : 1000px !default;
33
+
34
+ $content-width : 1140px !default; // For grid
35
+
36
+ // ------------------------
37
+ // PIXEL --> EM CONVERTER
38
+ // ------------------------
39
+ $em-base : 16px !default;
40
+
41
+ // It strips the unit of measure and returns it
42
+ @function stripUnit($num) {
43
+ @return $num / ($num * 0 + 1);
44
+ }
45
+
46
+ // Convert the number to EM
47
+ @function convertToEm($value, $context: $em-base) {
48
+ // If not number, return it as is
49
+ @if type-of($value) != number { @return $value; }
50
+
51
+ $value: stripUnit($value) / stripUnit($em-base) * 1em;
52
+ // Turn 0em into 0
53
+ @if ($value == 0em) {
54
+ $value: 0;
55
+ }
56
+ @return $value;
57
+ }
58
+
59
+ // Based on: mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/
60
+ // EXAMPLE
61
+ // width : em(500px);
62
+ // padding : em(20px 30px 15px 10px);
63
+ // @include box-shadow(em(inset 2px 0 5px rgba(black, 0.3) ) );
64
+ @function em($values, $context: $em-base) {
65
+ // If the value only contain single number, return it quickly without the overhead further below
66
+ @if type-of($values) == number {
67
+ @return convertToEm($values, $context);
68
+ }
69
+
70
+ $emValues : (); // This will eventually store the converted $values in a list
71
+ @each $val in $values {
72
+ $emValues: append($emValues, convertToEm($val, $context) );
73
+ }
74
+ @return join((), $emValues, space );
75
+ }
76
+
77
+ // -------------------
78
+ // MEDIA QUERIES
79
+ // -------------------
80
+ $phone-screen : em(480px) !default;
81
+ $small-screen : em(767px) !default;
82
+ $medium-screen : em(1140px) !default;
83
+ $large-screen : em(1440px) !default;
84
+ $retina-screen : 192dpi !default;
85
+ // 480px and down
86
+ @mixin phone() {
87
+ @media only screen and (max-width: $phone-screen) { @content; }
88
+ }
89
+ // 767px and down
90
+ @mixin small() {
91
+ @media only screen and (max-width: $small-screen) { @content; }
92
+ }
93
+ // 768px and up. If you're planning to support IE8, NEVER use medium-up
94
+ @mixin medium-up() {
95
+ @media only screen and (min-width: $small-screen) { @content; }
96
+ }
97
+ // 1140px and down
98
+ @mixin medium() {
99
+ @media only screen and (max-width: $medium-screen) { @content; }
100
+ }
101
+ // large() is not needed, just put it outside media query
102
+
103
+ // 2x pixel ratio
104
+ @mixin retina() {
105
+ @media only screen and (-webkit-min-device-pixel-ratio: 2),
106
+ (min-resolution: $retina-screen) {
107
+ @content;
108
+ }
109
+ }
110
+ // Landscape orientation __
111
+ @mixin landscape {
112
+ @media only screen and (orientation: landscape) { @content; }
113
+ }
114
+ // Portrait orientation |
115
+ @mixin portrait {
116
+ @media only screen and (orientation: portrait) { @content; }
117
+ }
118
+
119
+ // ---------------------------------------------------
120
+ // SHINY EFFECT
121
+ // Give emboss feel to an element
122
+ //
123
+ // Use this in conjunction with Compass' box-shadow()
124
+ // @include box-shadow(shiny(right), ...)
125
+ // ---------------------------------------------------
126
+ @function shiny($applyTo: top, $activeState: false) {
127
+ @if $applyTo == top {
128
+ $size : 0 1px; }
129
+ @else if $applyTo == right {
130
+ $size : 1px 0; }
131
+ @else if $applyTo == left {
132
+ $size : -1px 0; }
133
+ @else if $applyTo == bottom {
134
+ $size : 0 -1px; }
135
+
136
+ // Initialize the shiny shadow
137
+ @if $activeState {
138
+ $shiny : inset $size 0 rgba(black, 0.2);
139
+ } @else {
140
+ $shiny : inset $size 0 rgba(white, 0.5);
141
+ }
142
+ @return $shiny;
143
+ }
144
+
145
+ // ----------------------------------------------
146
+ // CLEARING FLOAT
147
+ // Make a container wraps floated element
148
+ //
149
+ // If you prefer readable output, use the mixin
150
+ // If you prefer smaller output, use placeholder
151
+ // ----------------------------------------------
152
+ %clearfix {
153
+ zoom: 1;
154
+ &:before, &:after {
155
+ content : " ";
156
+ display : table;
157
+ }
158
+ &:after {
159
+ clear : both;
160
+ }
161
+ }
162
+ @mixin clearfix {
163
+ zoom: 1;
164
+ &:before, &:after {
165
+ content : " ";
166
+ display : table;
167
+ }
168
+ &:after {
169
+ clear : both;
170
+ }
171
+ }
172
+
173
+
174
+ // --------------------------------
175
+ // SELECTION
176
+ // Change the text highlight color
177
+ // --------------------------------
178
+ @mixin selection($color: lighten($main-color, 35%) ) {
179
+ ::-moz-selection {
180
+ background : $scolor;
181
+ text-shadow : none;
182
+ }
183
+ ::selection {
184
+ background : $color;
185
+ text-shadow : none;
186
+ }
187
+ }
188
+
189
+ // ------------------------------------------------------
190
+ // DISABLE SELECTION
191
+ // Prevents user to select/highlight the element's text
192
+ // ------------------------------------------------------
193
+ %disable-user-select {
194
+ -webkit-touch-callout : none;
195
+ -webkit-user-select : none;
196
+ -khtml-user-select : none;
197
+ -moz-user-select : none;
198
+ -ms-user-select : none;
199
+ user-select : none;
200
+ }
201
+
202
+ // ---------------------
203
+ // TEXT DIRECTION
204
+ // ---------------------
205
+ $text-direction : ltr !default; // Controls default global text direction, 'rtl' or 'ltr'
206
+ $default-float : left !default;
207
+ $default-opposite : right !default;
208
+ // No need to change this conditional statement, $text-direction variable controls it all.
209
+ @if $text-direction == ltr {
210
+ $default-float : left;
211
+ $default-opposite : right;
212
+ } @else {
213
+ $default-float : right;
214
+ $default-opposite : left;
215
+ }
216
+
217
+ // ----------------------------------------------------------
218
+ // TRIANGLE
219
+ // Create a triangle
220
+ //
221
+ // Don't specify the `height` to create equalateral triangle
222
+ // ----------------------------------------------------------
223
+ @mixin triangle($direction, $color, $width, $height: false) {
224
+ // If height is not specified, make the triangle equalateral
225
+ @if not $height {
226
+ // If normal triangle, `height` is set to half `width`
227
+ @if $direction == top or
228
+ $direction == right or
229
+ $direction == left or
230
+ $direction == bottom {
231
+ $height : $width/2;
232
+ }
233
+ // Else if corner triangle, `heigth` is the same as `width`
234
+ @else if $direction == top-right or
235
+ $direction == top-left or
236
+ $direction == bottom-right or
237
+ $direction == bottom-left {
238
+ $height : $width;
239
+ }
240
+ }
241
+ width : 0;
242
+ height : 0;
243
+ font-size : 0;
244
+ line-height : 0%;
245
+ border-style : solid;
246
+ border-color : transparent;
247
+ // Top /\
248
+ @if $direction == top {
249
+ border-width : 0 $width/2 $height $width/2;
250
+ border-bottom-color : $color;
251
+ }
252
+ // Right |>
253
+ @else if $direction == right {
254
+ border-width : $width/2 0 $width/2 $height;
255
+ border-left-color : $color;
256
+ }
257
+ // Bottom \/
258
+ @else if $direction == bottom {
259
+ border-width : $height $width/2 0 $width/2;
260
+ border-top-color : $color;
261
+ }
262
+ // Left <|
263
+ @else if $direction == left {
264
+ border-width : $width/2 $height $width/2 0;
265
+ border-right-color : $color;
266
+ }
267
+
268
+ // __
269
+ // Top-right \ |
270
+ // \|
271
+ @else if $direction == top-right {
272
+ border-width : 0 $width $height 0;
273
+ border-right-color : $color;
274
+ }
275
+
276
+ // Bottom-right /|
277
+ // /_|
278
+ @else if $direction == bottom-right {
279
+ border-width : 0 0 $height $width;
280
+ border-bottom-color : $color;
281
+ }
282
+ // Bottom-left |\
283
+ // |_\
284
+ @else if $direction == bottom-left {
285
+ border-width : $height 0 0 $width;
286
+ border-left-color : $color;
287
+ }
288
+ // __
289
+ // Top-left | /
290
+ // |/
291
+ @else if $direction == top-left {
292
+ border-width : $height $width 0 0;
293
+ border-top-color : $color;
294
+ }
295
+ }
@@ -0,0 +1,9 @@
1
+ @import "components/normalize";
2
+ @import "components/main";
3
+ @import "components/grid";
4
+ @import "components/block_grid";
5
+ @import "components/print";
6
+ @import "components/form";
7
+ @import "components/visibility";
8
+ // @import "components/typography";
9
+ // @import "components/form";
@@ -0,0 +1,2 @@
1
+ @import "helpers/sprites";
2
+ @import "helpers/sticky-footer";
@@ -0,0 +1,99 @@
1
+ /* ---------------
2
+ EDGE Block Grid
3
+ --------------- */
4
+ // Based on Zurb's Foundation
5
+
6
+ $block-grid-max-width : em($content-width) !default;
7
+ $block-grid-total : 12 !default;
8
+ $block-grid-margin : em(25px) !default;
9
+
10
+ // Calculate percentages for block-grid
11
+ @function blockGridCalc($blockNum, $totalBlock:$block-grid-total, $collapse:false) {
12
+ $baseSize : 100% / $blockNum;
13
+
14
+ // Reduce size due to margin between grid.
15
+ $fillSize : 0 !default;
16
+ @if $collapse == false { // -2% / 4
17
+ $fillSize : ( gridMarginCalc() * ( $blockNum - 1 ) / $blockNum );
18
+ }
19
+
20
+ @return $baseSize - $fillSize;
21
+ }
22
+
23
+ // Calculate percentages for Margin between block-grid
24
+ @function blockGridMarginCalc($blockMargin: $block-grid-margin, $maxWidth: $block-grid-max-width) {
25
+ @return percentage( $blockMargin / $maxWidth );
26
+ }
27
+
28
+ @mixin block-grid($block-num : false,
29
+ $spacing : $block-grid-margin,
30
+ $base-style : true,
31
+ $collapse : false) {
32
+
33
+ @if $base-style {
34
+ display : block;
35
+ padding : 0;
36
+ @include clearfix;
37
+
38
+ &> li {
39
+ display : block;
40
+ height : auto;
41
+ float : $default-float;
42
+ @if $collapse == false {
43
+ margin-#{$default-opposite} : blockGridMarginCalc($spacing);
44
+ } @else {
45
+ margin-#{$default-opposite} : 0;
46
+ }
47
+ }
48
+ }
49
+
50
+ @if $block-num {
51
+ &>li {
52
+ width : blockGridCalc($block-num, $collapse: $collapse);
53
+ @if $collapse == false {
54
+ &:nth-of-type(#{$block-num}n) {
55
+ margin-#{$default-opposite} : 0;
56
+ }
57
+ }
58
+
59
+ // &:nth-of-type(#{$block-num}n+1) {
60
+ // clear: both;
61
+ // }
62
+ }
63
+ }
64
+ }
65
+
66
+ [class*="block-grid-"] { @include block-grid; }
67
+
68
+ // Large block grid
69
+ @for $i from 2 through $block-grid-total {
70
+ .large-block-grid-#{($i)} {
71
+ @include block-grid($i, $base-style: false);
72
+
73
+ &.collapse {
74
+ @include block-grid($i, $base-style: false, $collapse: true);
75
+ }
76
+ }
77
+ }
78
+
79
+ @include small {
80
+ [class*="small-block-grid-"] > li { clear: none !important; }
81
+
82
+ // Reset large-block-grid nth-child margin
83
+ [class*="large-block-grid-"] > li:nth-child(n+1) {
84
+ margin-#{$default-opposite} : blockGridMarginCalc($block-grid-margin);
85
+ }
86
+
87
+ // Small block grid
88
+ @for $i from 2 through $block-grid-total {
89
+ .small-block-grid-#{($i)} {
90
+ @include block-grid($i, $base-style: false);
91
+ &.collapse {
92
+ @include block-grid($i, $base-style: false, $collapse: true);
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ // Base style for collapsed block-grid, written below to override other style
99
+ [class*="block-grid-"].collapse { @include block-grid($collapse: true); }
@@ -0,0 +1,15 @@
1
+
2
+
3
+ // Remove the delete (x) mark from IE
4
+ input::-ms-clear {
5
+ display: none;
6
+ }
7
+
8
+ // Disable Chrome's datepicker
9
+ input::-webkit-calendar-picker-indicator{
10
+ display: none;
11
+ }
12
+
13
+ input[type="date"]::-webkit-input-placeholder{
14
+ visibility: hidden !important;
15
+ }