edge_framework 0.1.0 → 0.2.0

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 (57) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +6 -3
  3. data/assets/sass/edge/_base.scss +78 -28
  4. data/assets/sass/edge/_components.scss +8 -5
  5. data/assets/sass/edge/_helpers.scss +18 -1
  6. data/assets/sass/edge/components/{_block_grid.scss → _block-grid-margin.scss} +25 -12
  7. data/assets/sass/edge/components/_block-grid.scss +110 -0
  8. data/assets/sass/edge/components/_button.scss +50 -0
  9. data/assets/sass/edge/components/_form.scss +3 -1
  10. data/assets/sass/edge/components/_grid-margin.scss +309 -0
  11. data/assets/sass/edge/components/_grid.scss +147 -205
  12. data/assets/sass/edge/components/_main.scss +26 -16
  13. data/assets/sass/edge/components/_normalize.scss +5 -1
  14. data/assets/sass/edge/components/_print.scss +6 -1
  15. data/assets/sass/edge/components/_typography.scss +29 -0
  16. data/assets/sass/edge/components/_visibility.scss +43 -51
  17. data/assets/sass/edge.scss +9 -6
  18. data/assets/sass/for-test.scss +75 -0
  19. data/bin/edge +5 -1
  20. data/lib/edge/message.rb +38 -0
  21. data/lib/edge/version.rb +2 -1
  22. data/lib/edge_framework.rb +36 -21
  23. data/site/assets/css/app.css +44 -8
  24. data/site/assets/css/edge.css +83 -40
  25. data/site/assets/img/favicon-big.png +0 -0
  26. data/site/assets/img/favicon.png +0 -0
  27. data/site/assets/img/logo/edge-full.svg +19 -0
  28. data/site/assets/img/logo/edge-logo-transparent.svg +10 -0
  29. data/site/assets/img/logo/edge-logo.svg +19 -0
  30. data/site/assets/sass/_setting.scss +44 -15
  31. data/site/assets/sass/app.scss +203 -18
  32. data/site/assets/sass/edge.scss +2 -2
  33. data/site/config.rb +1 -1
  34. data/site/views/docs/grid.erb +44 -69
  35. data/site/views/index.erb +54 -6
  36. data/site/views/layout.erb +42 -10
  37. data/site/views/partials/_logo.erb +5 -0
  38. data/site/views/partials/_logo_full.erb +14 -0
  39. data/template/base/.gitignore +243 -0
  40. data/template/base/assets/css/.keep +0 -0
  41. data/template/base/assets/files/.keep +0 -0
  42. data/template/base/assets/img/favicon-big.png +0 -0
  43. data/template/base/assets/sass/_setting.scss +82 -26
  44. data/template/base/assets/sass/edge-framework.scss +7 -0
  45. data/template/base/robots.txt +7 -0
  46. data/template/html/index.html +4 -3
  47. data/template/php/index.php +8 -2
  48. data/template/php/partials/_footer.php +2 -2
  49. data/template/php/partials/_header.php +20 -4
  50. data/template/php/sample-page/index.php +11 -0
  51. metadata +20 -9
  52. data/assets/js/edge.min.js +0 -1
  53. data/assets/sass/edge/components/_palette.scss +0 -24
  54. data/lib/edge/engine.rb +0 -16
  55. data/site/assets/css/normalize.min.css +0 -51
  56. data/site/assets/js/vendor/handlebars.min.js +0 -2
  57. data/template/base/assets/sass/edge.scss +0 -3
@@ -1,56 +1,49 @@
1
- /* ---------------
2
- EDGE Grid
3
- --------------- */
4
- // Based on Zurb's Foundation
1
+ // -----------------------------------------
2
+ // GRID
3
+ // Based heavily on ZURB's Foundation
4
+ // -----------------------------------------
5
5
 
6
- $row-width : em($content-width) !default;
7
- $column-padding : em(0px) !default;
8
- $column-margin : em(25px) !default; // Margin between column at maximum row's width
6
+ $column-distance : 30px !default;
7
+ $row-max-width : $content-width !default;
9
8
  $total-columns : 12 !default;
10
9
 
11
10
  // Calculate percentages for grid
12
- @function gridCalc($colNumber, $totalColumns: $total-columns, $collapse: false ) {
13
- $baseSize : percentage( $colNumber / $totalColumns );
14
-
15
- // Additional size due to margin between grid.
16
- $fillSize : 0 !default;
17
- @if $collapse == false {
18
- $fillSize : $colNumber * ( gridMarginCalc() / $totalColumns );
19
- }
20
-
21
- @return $baseSize + $fillSize;
11
+ @function gridCalc($colNumber, $totalColumns:$total-columns) {
12
+ @return percentage($colNumber / $totalColumns);
22
13
  }
23
14
 
24
- // Calculate percentages for Margin between grid
25
- @function gridMarginCalc($colMargin: $column-margin, $rowWidth: $row-width) {
26
- @return percentage( $colMargin / $rowWidth );
27
- }
15
+ // For creating container, nested, and collapsed rows.
16
+ @mixin grid-row(
17
+ $behavior : false,
18
+ $for-base : false,
19
+ $max-width : $row-max-width,
20
+ $distance : $column-distance ) {
21
+
22
+ $max-width : em($max-width) + em($distance); // to make up for the padding
28
23
 
29
- // Create ROW
30
- @mixin grid-row($behavior: false, $minify: false) {
31
- @if $minify == false {
24
+ // prevent duplicate for base CSS class
25
+ @if $for-base == false {
32
26
  @include clearfix;
33
27
  }
28
+
34
29
  // use @include grid-row(nest); to include a nested row
35
30
  @if $behavior == nest {
36
- width : auto;
37
- max-width : none;
38
- margin-left : -($column-padding);
39
- margin-right : -($column-padding);
31
+ width : auto;
32
+ max-width : none;
33
+ margin-#{$default-float} : -($distance / 2);
34
+ margin-#{$default-opposite} : -($distance / 2);
40
35
  }
36
+
41
37
  // use @include grid-row(collapse); to collapse a container row margins
42
38
  @else if $behavior == collapse {
43
39
  width : 100%;
44
- max-width : $row-width;
40
+ max-width : $max-width;
45
41
  margin : 0;
42
+
46
43
  }
47
- // use @include grid-row(nest-in-non-collapse); to collapse outer margins of nested-row inside non-collapsed-row
48
- @else if $behavior == nest-in-non-collapse {
49
- width : auto;
50
- max-width : none;
51
- }
52
- // use @include grid-row(nest-in-collapse); to collapse outer margins of nested-row inside collapsed-row
53
- @else if $behavior == nest-in-collapse {
44
+
45
+ // use @include grid-row(nest-collapse); to collapse outer margins on a nested row
46
+ @else if $behavior == nest-collapse {
54
47
  width : auto;
55
48
  max-width : none;
56
49
  margin : 0;
@@ -59,243 +52,192 @@ $total-columns : 12 !default;
59
52
  // use @include grid-row; to use a container row
60
53
  @else {
61
54
  width : 100%;
62
- max-width : $row-width;
55
+ max-width : $max-width;
63
56
  margin : 0 auto;
64
57
  }
65
58
  }
66
59
 
67
- // Create COLUMN
68
- @mixin grid-column($columns : false,
69
- $last-column : false,
70
- $center : false,
71
- $offset : false,
72
- $push : false,
73
- $pull : false,
74
- $collapse : false,
75
- $minify : false, // Remove style redundancy
76
- $float : left ) {
60
+ // For creating columns - @include these inside a media query to control small vs. large grid layouts
61
+ @mixin grid-column(
62
+ $columns : false,
63
+ $last-column : false,
64
+ $center : false,
65
+ $offset : false,
66
+ $push : false,
67
+ $pull : false,
68
+ $collapse : false,
69
+ $float : true,
70
+ $for-base : false,
71
+ $distance : $column-distance,
72
+ $total-columns : $total-columns,
73
+ $external : $external-call, // Mixin used from external file
74
+ $small : false // For usage by external file, apply CSS for small-grid
75
+ ) {
77
76
 
78
- $not-for-columns : $push == false and $pull == false;
79
- // If column number not specified
80
- @if $columns == false and $minify and $not-for-columns {
81
- position : relative;
82
- margin-#{$default-opposite} : gridMarginCalc();
83
- &:last-child { margin-#{$default-opposite} : 0; }
84
- }
85
-
86
- // If not collapse, add padding
87
- @if $collapse == false and $minify == false {
88
- padding-left : $column-padding;
89
- padding-right : $column-padding;
77
+ @if $for-base == false {
78
+ position: relative;
90
79
  }
91
80
 
92
- // If collapsed, remove padding and margin
93
- @if $collapse and $minify == false {
81
+ // If collapsed, get rid of distance padding
82
+ @if $collapse {
94
83
  padding-left : 0;
95
84
  padding-right : 0;
96
- margin-#{$default-opposite} : 0;
97
85
  }
98
86
 
99
- // If collapsed and no column-number given, remove margin between grid
100
- @if $collapse and $columns == false and $minify == true {
101
- margin-#{$default-opposite} : 0;
87
+ // Distance padding whenever a column isn't set to collapse
88
+ // (use $collapse:null to do nothing)
89
+ @else if $collapse == false {
90
+ padding-left : $distance / 2;
91
+ padding-right : $distance / 2;
102
92
  }
103
-
93
+
104
94
  // If a column number is given, calculate width
105
95
  @if $columns {
106
- @if $minify == false { position : relative; }
107
- // If collapsed, recalculate the width
108
- @if $collapse {
109
- width : gridCalc($columns, $collapse: true);
110
- }
111
- // Else, reduce the width with the margin
112
- @else {
113
- width : gridCalc($columns) - gridMarginCalc();
96
+ width : gridCalc($columns, $total-columns);
114
97
 
115
- @if $minify == false {
116
- margin-#{$default-opposite} : gridMarginCalc();
117
-
118
- // If last-column specified explicitly
119
- @if $last-column {
120
- margin-#{$default-opposite} : 0;
121
- } @else {
122
- &:last-child { margin-#{$default-opposite} : 0; }
123
- }
124
- }
98
+ // If last column, float naturally instead of to the right
99
+ @if $last-column {
100
+ float: $default-opposite;
125
101
  }
126
102
  }
127
103
 
128
104
  // If offset, calculate appropriate margins
129
- @if $offset {
130
- margin-#{$default-float}: gridCalc($offset, $collapse:$collapse);
105
+ @if $offset {
106
+ margin-#{$default-float}: gridCalc($offset, $total-columns);
131
107
  }
132
108
 
133
109
  // Source Ordering, adds left/right depending on which you use.
134
110
  @if $push {
135
- @if $minify == false { position : relative; }
136
- #{$default-float} : gridCalc($push, $collapse: $collapse);
111
+ #{$default-float} : gridCalc($push, $total-columns);
137
112
  #{$default-opposite} : auto;
138
113
  }
139
114
  @if $pull {
140
- @if $minify == false { position : relative; }
141
- #{$default-opposite} : gridCalc($pull, $collapse: $collapse);
115
+ #{$default-opposite} : gridCalc($pull, $total-columns);
142
116
  #{$default-float} : auto;
143
117
  }
118
+
144
119
  // If centered, get rid of float and add appropriate margins
145
120
  @if $center {
146
- margin-left : auto !important;
147
- margin-right : auto !important;
148
- float : none !important;
121
+ margin-#{$default-float} : auto !important;
122
+ margin-#{$default-opposite} : auto !important;
123
+ float : none !important;
149
124
  }
125
+
150
126
  @if $float {
151
- @if $float == left or true {
152
- float : $default-float;
153
- } @else if $float == right {
154
- float : $default-opposite;
155
- } @else {
156
- float : none;
127
+ @if $float == left or $float == true {
128
+ float: $default-float;
129
+ }
130
+ @else if $float == right {
131
+ float: $default-opposite;
132
+ }
133
+ @else {
134
+ float: none;
135
+ }
136
+ }
137
+
138
+ // If used from external file and size is not small
139
+ @if $external {
140
+ @if $small == false {
141
+ @include small {
142
+ width : 100%;
143
+ }
157
144
  }
158
145
  }
159
146
  }
160
147
 
161
- // CSS
148
+ @if $include-grid {
149
+
150
+ /* ---------------
151
+ EDGE Grid
152
+ --------------- */
153
+
162
154
  body {
163
155
  &.not-responsive {
164
- min-width : $row-width;
156
+ min-width : $row-max-width;
165
157
  }
166
158
  &.only-responsive-below-small {
167
- min-width : $row-width;
159
+ min-width : $row-max-width;
168
160
  @include small {
169
161
  min-width : 0;
170
162
  }
171
163
  }
172
164
  }
173
- // For `normal-row`
165
+
174
166
  .row {
175
167
  @include grid-row;
176
168
 
177
- .column,
178
- .columns {
179
- @include grid-column($columns: false, $minify: true);
180
-
181
- &.last { margin-#{$default-opposite} : 0 !important; }
182
- }
183
-
184
- // Width for `normal-row`
185
- @for $i from 1 through $total-columns {
186
- .large-#{$i} {
187
- @include grid-column($columns:$i, $collapse:null, $float:false, $minify: true );
188
- }
189
- }
190
-
191
- // For `collapsed-row`
169
+ // Collapsed row
192
170
  &.collapse {
193
171
  .column,
194
172
  .columns {
195
- @include grid-column($collapse: true);
196
- }
197
-
198
- // For `nested-row inside collapsed-row`, it's automatically collapsed
199
- .row {
200
- @include grid-row($behavior: nest-in-collapse, $minify: true);
201
-
202
- .column,
203
- .columns {
204
- @include grid-column($columns: false, $collapse: true, $minify: true);
205
- }
206
- }
207
-
208
- @for $i from 1 through $total-columns {
209
- .large-#{$i} {
210
- @include grid-column($columns:$i, $collapse:true, $float:false, $minify: true );
211
- }
173
+ @include grid-column($collapse:true, $for-base:false);
212
174
  }
213
175
  }
214
-
215
- // For `nested-row`
176
+
177
+ // Nested-collapsed row
216
178
  .row {
217
- @include grid-row($behavior: nest, $minify: true);
218
- }
219
-
220
- // Offset for large columns
221
- @for $i from 1 through $total-columns - 2 {
222
- .large-offset-#{$i} {
223
- @include grid-column($offset:$i, $collapse:null, $float:false );
179
+ @include grid-row($behavior:nest);
180
+ &.collapse {
181
+ @include grid-row($behavior:nest-collapse); }
224
182
  }
225
183
  }
226
- }
184
+
185
+ // Normal column
186
+ .column,
187
+ .columns {
188
+ @include grid-column($columns:$total-columns);
189
+ }
190
+
227
191
 
228
- .column.large-centered,
229
- .columns.large-centered {
230
- @include grid-column($center:true, $collapse:null, $float:false );
231
- }
192
+ @for $i from 1 through $total-columns {
193
+ .large#{-$i} { @include grid-column($columns:$i, $collapse:null, $float:false, $for-base:true); }
194
+ }
232
195
 
233
- // Push and pull for large-columns
234
- @for $i from 2 through $total-columns - 2 {
235
- .row {
236
- .push-#{$i} {
237
- @include grid-column($push:$i, $collapse:false, $float:false, $minify:true ); }
238
- .pull-#{$i} {
239
- @include grid-column($pull:$i, $collapse:false, $float:false, $minify:true ); }
240
- &.collapse {
241
- .push-#{$i} {
242
- @include grid-column($push:$i, $collapse:true, $float:false, $minify:true ); }
243
- .pull-#{$i} {
244
- @include grid-column($pull:$i, $collapse:true, $float:false, $minify:true ); }
196
+ @for $i from 0 through $total-columns - 1 {
197
+ .row .large-offset-#{$i} {
198
+ @include grid-column($offset:$i, $collapse:null, $float:false, $for-base:true);
245
199
  }
246
200
  }
247
- }
248
201
 
249
- @include medium-up {
250
- @for $i from 2 through $total-columns - 2 {
251
- .small-push-#{$i} {
252
- left: inherit;
253
- }
254
- .small-pull-#{$i} {
255
- right: inherit;
256
- }
202
+ // Centered column
203
+ .column.large-centered,
204
+ .columns.large-centered {
205
+ @include grid-column($center:true, $collapse:null, $float:false);
257
206
  }
258
- }
259
207
 
260
- @include small {
261
- // Set all `large` columns to 100%
262
- .row .column,
263
- .row .columns,
264
- .row.collapse .column,
265
- .row.collapse .columns {
266
- @include grid-column($columns: $total-columns, $minify: true);
267
-
268
- // Reset push and pull
269
- &[class*="push"], &[class*="pull"] {
270
- left : auto;
271
- right : auto;
208
+ @include medium-up {
209
+ @for $i from 1 through $total-columns - 1 {
210
+ .push#{-$i} {
211
+ @include grid-column($push:$i, $collapse:null, $float:false, $for-base:true);
212
+ }
213
+ .pull#{-$i} {
214
+ @include grid-column($pull:$i, $collapse:null, $float:false, $for-base:true);
215
+ }
272
216
  }
273
217
  }
274
-
275
- // Reset large-offset
276
- .row {
277
- [class*="large-offset"] {
278
- margin-left : 0;
218
+
219
+ // Small screen and below
220
+ @include small {
221
+ .column,
222
+ .columns {
223
+ @include grid-column($columns:$total-columns);
279
224
  }
280
- }
281
225
 
282
- // Small columns
283
- @for $i from 1 through $total-columns {
284
- .row .small-#{$i} {
285
- @include grid-column($columns:$i, $collapse:null, $float:false, $minify: true );
226
+ @for $i from 1 through $total-columns {
227
+ .small#{-$i} {
228
+ @include grid-column($columns:$i, $collapse:null, $float:false, $for-base:true);
229
+ }
286
230
  }
287
- }
288
-
289
- // Small offset
290
- @for $i from 1 through $total-columns - 2 {
291
- .row {
292
- .small-offset-#{$i}, &.collapse .small-offset-#{$i} {
293
- @include grid-column($offset:$i, $collapse:null, $float:false );
231
+
232
+ @for $i from 0 through $total-columns - 2 {
233
+ .small-offset-#{$i} {
234
+ @include grid-column($offset:$i, $collapse:null, $float:false, $for-base:true);
294
235
  }
295
236
  }
237
+
238
+ .column.small-centered,
239
+ .columns.small-centered {
240
+ @include grid-column($center:true, $collapse:null, $float:false);
241
+ }
296
242
  }
297
- .column.small-centered,
298
- .columns.small-centered {
299
- @include grid-column($center:true, $collapse:null, $float:false );
300
- }
301
- }
243
+ } // $include-grid
@@ -1,7 +1,11 @@
1
+ @if $include-main {
2
+
1
3
  /* ------------------
2
4
  EDGE Boilerplate
3
5
  --------------------- */
4
6
 
7
+ * { margin: 0; padding: 0; }
8
+
5
9
  // Set box-sizing globally to handle padding and border widths
6
10
  *,
7
11
  *:before,
@@ -18,8 +22,6 @@ body {
18
22
  position : relative;
19
23
  background : $body-bg;
20
24
  color : $body-font-color;
21
- padding : 0;
22
- margin : 0;
23
25
  font-family : $body-font-family;
24
26
  font-weight : $body-font-weight;
25
27
  font-style : $body-font-style;
@@ -36,6 +38,17 @@ p {
36
38
  margin-bottom : 0;
37
39
  }
38
40
 
41
+ a {
42
+ display : inline-block;
43
+ cursor : pointer;
44
+ text-decoration : none;
45
+ }
46
+
47
+ // Clear bullet or numbering on plain <ul> and <ol>
48
+ ul, ol {
49
+ list-style: none;
50
+ }
51
+
39
52
  // A better looking default horizontal rule
40
53
  hr {
41
54
  display : block;
@@ -49,7 +62,7 @@ hr {
49
62
  // Override `normalize` part that we don't like
50
63
  a:focus { outline: none; }
51
64
 
52
- h1 { margin: 0; }
65
+ h1, h2, h3, h4, h5, h6 { margin: 0; }
53
66
 
54
67
  fieldset {
55
68
  border : 0;
@@ -57,7 +70,6 @@ fieldset {
57
70
  padding : 0;
58
71
  }
59
72
 
60
-
61
73
  // Grid Defaults to get images and embeds to work properly
62
74
  img,
63
75
  object,
@@ -94,7 +106,6 @@ img {
94
106
  -ms-interpolation-mode: bicubic;
95
107
  }
96
108
 
97
-
98
109
  // Chrome Sibling Selector Fix
99
110
  body {
100
111
  -webkit-animation: bugfix infinite 1s;
@@ -105,16 +116,6 @@ body {
105
116
  to { padding: 0; }
106
117
  }
107
118
 
108
- // Disable text-shadow on selection
109
- ::-moz-selection {
110
- background : #3297fd;
111
- text-shadow : none;
112
- }
113
- ::selection {
114
- background : #3297fd;
115
- text-shadow : none;
116
- }
117
-
118
119
  // -----------------------------------
119
120
  /* Miscellaneous useful HTML classes */
120
121
  // -----------------------------------
@@ -139,5 +140,14 @@ body {
139
140
  .bold, b, strong { font-weight: 700 !important; }
140
141
  .italic, em { font-style: italic !important; }
141
142
 
143
+ ul.inline, ol.inline {
144
+ list-style-type : none;
145
+ li {
146
+ display : inline-block;
147
+ }
148
+ }
149
+
142
150
  // Font smoothing, only works on Safari Webkit
143
- .antialiased { -webkit-font-smoothing: antialiased; }
151
+ .antialiased { -webkit-font-smoothing: antialiased; }
152
+
153
+ }
@@ -1,3 +1,5 @@
1
+ @if $include-normalize {
2
+
1
3
  /* ---------------------------
2
4
  Normalize | git.io/normalize
3
5
  ------------------------------ */
@@ -46,4 +48,6 @@ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webki
46
48
  button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
47
49
  textarea { overflow: auto; vertical-align: top; }
48
50
 
49
- table { border-collapse: collapse; border-spacing: 0; }
51
+ table { border-collapse: collapse; border-spacing: 0; }
52
+
53
+ }
@@ -1,3 +1,5 @@
1
+ @if $include-print {
2
+
1
3
  /* ------------------------------
2
4
  H5BP PRINT
3
5
  - Style for printing the website
@@ -68,4 +70,7 @@ H5BP PRINT
68
70
  h3 {
69
71
  page-break-after: avoid;
70
72
  }
71
- }
73
+ }
74
+
75
+ }
76
+
@@ -1,4 +1,33 @@
1
+ // HEADER
2
+ $h1-font-size: em(44px) !default;
3
+ $h2-font-size: em(37px) !default;
4
+ $h3-font-size: em(27px) !default;
5
+ $h4-font-size: em(23px) !default;
6
+ $h5-font-size: em(18px) !default;
7
+ $h6-font-size: 1em !default;
8
+
9
+ $header-font-weight: 700 !default;
10
+
11
+
12
+ @if $include-typography {
13
+
1
14
  /* ---------------
2
15
  EDGE Typography
3
16
  --------------- */
4
17
 
18
+ h1 { font-size: $h1-font-size }
19
+ h2 { font-size: $h2-font-size }
20
+ h3 { font-size: $h3-font-size }
21
+ h4 { font-size: $h4-font-size }
22
+ h5 { font-size: $h5-font-size; }
23
+ h6 { font-size: $h6-font-size; }
24
+
25
+
26
+ code {
27
+ display : inline-block;
28
+ &, pre {
29
+ font-family: $code-font-family;
30
+ }
31
+ }
32
+
33
+ }