edge_framework 1.4.1 → 2.0.0.a

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.
data/README.md CHANGED
@@ -3,98 +3,114 @@
3
3
  EDGE FRAMEWORK
4
4
  ==========================
5
5
 
6
- Edge is a light-weight responsive Sass framework. No gimmick, just the barebone to build modern website.
6
+ Edge is a light-weight Sass framework. It specializes in making a website from scratch.
7
7
 
8
8
  It is based on [Foundation by ZURB](http://www.zurb.com).
9
9
 
10
- **OUR PHILOSOPHY**
10
+ This is **v2 docs**, [go here for v1](https://github.com/hrsetyono/edge/wiki/v1-Docs).
11
11
 
12
- My personal preference is to have a framework not do something and implement it myself than have a framework do something and figure out how to do the opposite.
12
+ BROWSER SUPPORT
13
+ ------------------
14
+
15
+ All modern browsers:
16
+
17
+ - Chrome, Firefox, Safari, Opera
18
+ - Android 4.0 and above
19
+ - IE 9 and above
13
20
 
14
21
  INSTALLATION
15
22
  -----------------
16
23
 
24
+ **PC**
25
+
26
+ [Install Ruby]((https://docs.google.com/document/d/155e-Dx4SnQj_bMrM24kI4_ZEmBp-TQ_tuinhMvZsIhM/edit?usp=sharing) and type this command in your *cmd* (command prompt):
27
+
17
28
  gem install edge_framework
18
29
 
19
- Windows PC doesn't come with Ruby pre-installed, so you can follow [this Ruby installation guide](https://docs.google.com/document/d/155e-Dx4SnQj_bMrM24kI4_ZEmBp-TQ_tuinhMvZsIhM/edit?usp=sharing) we wrote.
30
+ **MAC**
20
31
 
21
- After you installed Ruby, type in the command above on `cmd` (command prompt).
32
+ Open your *terminal* and type:
22
33
 
23
- BROWSER SUPPORT
34
+ sudo gem install edge_framework
35
+
36
+ GETTING STARTED
24
37
  ------------------
25
38
 
26
- All modern browsers:
39
+ Generate the template files by running this command in your project directory:
27
40
 
28
- - Chrome, Firefox, Safari, Opera
29
- - Android 4.0 and above
30
- - IE 9 and above
41
+ edge create <type>
42
+
43
+ Available types are: `html`, `wordpress`, `email`, and `ghost`.
44
+
45
+ To compile the Sass, run this command:
46
+
47
+ compass watch
31
48
 
32
49
  GRID SYSTEM
33
50
  ==================
34
- .row
35
- .column
36
- .large-x
37
- .small-x
51
+
52
+ <h-row>
53
+ <h-column>
38
54
 
39
- Our Grid is divided into **12 columns**. Start with "row" followed by "column" used in conjunction with its width.
55
+ Our Grid is divided into **12 columns**. Start with `<h-row>` followed by `<h-column>`.
40
56
 
41
- <div class="row">
42
- <div class="large-8 column"></div>
43
- <div class="large-4 column"></div>
44
- </div>
57
+ <h-row>
58
+ <h-column class="large-8"></h-column>
59
+ <h-column class="large-4"></h-column>
60
+ </h-row>
45
61
 
46
62
  ![Edge Grid - Large only](http://cdn.setyono.net/edge/grid-large.jpg)
47
63
 
48
- <div class="row">
49
- <div class="large-8 small-6 column"></div>
50
- <div class="large-4 small-6 column"></div>
51
- </div>
64
+ <h-row>
65
+ <h-column class="large-8 small-6"></h-column>
66
+ <h-column class="large-4 small-6"></h-column>
67
+ </h-row>
52
68
 
53
69
  ![Edge Grid - Large and Small](http://cdn.setyono.net/edge/grid-large-small.jpg)
54
70
 
55
- The element doesn't have to be div, it can be section, article, header, etc.
71
+ **Note**:
56
72
 
57
- Sizing:
73
+ - `h-row` must be followed by `h-column`. Nothing in between!
58
74
 
59
- - Large - above 768px
75
+ - Don't add your own styling to the row or column element.
60
76
 
61
- - Small - below or equal to 768px, width will be 100% if not specified.
77
+ - Large is above 768px by default.
62
78
 
63
- **Convention**:
64
-
65
- - Don't add your own style to the `.row` and `.column` elements.
79
+ - Small is below or equal to 768px. If not specified, column will become 100% width.
66
80
 
67
81
  Nesting
68
82
  -----------
69
83
 
70
- <div class="row">
71
- <div class="large-8 column">
72
- <div class="row">
73
- <div class="large-2 column"></div>
74
- <div class="large-10 column"></div>
75
- </div>
76
- </div>
77
- <div class="large-4 column"></div>
78
- </div>
84
+ <h-row>
85
+ <h-column class="large-8">
86
+ <h-row>
87
+ <h-column class="large-2"></h-column>
88
+ <h-column class="large-10"></h-column>
89
+ </h-row>
90
+ </h-column>
91
+ <h-column class="large-4"></h-column>
92
+ </h-row>
79
93
 
80
94
  ![Edge Grid - Nesting](http://cdn.setyono.net/edge/grid-nesting.jpg)
81
95
 
82
96
  Collapse
83
97
  -----------
84
98
 
85
- .row.collapse
99
+ .collapse
86
100
 
87
101
  Remove the gutter.
88
102
 
89
- <div class="row collapse">
90
- <div class="large-9 small-6 column"></div>
91
- <div class="large-3 small-6 column"></div>
92
- </div>
93
-
94
- All nested rows inside collapsed one will be collapsed too.
103
+ <h-row class="collapse">
104
+ <h-column class="large-9 small-6"></h-column>
105
+ <h-column class="large-3 small-6"></h-column>
106
+ </h-row>
95
107
 
96
108
  ![Edge Grid - Collapse](http://cdn.setyono.net/edge/grid-collapse.jpg)
97
109
 
110
+ **Note**:
111
+
112
+ - Normal row that is nested inside collapsed row will maintain its gutter.
113
+
98
114
  Centering
99
115
  -----------
100
116
 
@@ -105,9 +121,9 @@ Horizontally centering a column.
105
121
 
106
122
  It is inherited on small screen.
107
123
 
108
- <div class="row">
109
- <div class="large-7 small-7 centered column"></div>
110
- </div>
124
+ <h-row>
125
+ <h-column class="large-7 small-7 centered"></h-column>
126
+ </h-row>
111
127
 
112
128
  ![Edge Grid - Centered](http://cdn.setyono.net/edge/grid-centered.jpg)
113
129
 
@@ -121,51 +137,31 @@ Offset leaves a **gap** before the column.
121
137
 
122
138
  It is ignored on small screen unless the small sizing is specified.
123
139
 
124
- <div class="row">
125
- <div class="large-2 column"></div>
126
- <div class="large-6 offset-4 column"></div>
127
- </div>
140
+ <h-row>
141
+ <h-column class="large-2 column"></h-column>
142
+ <h-column class="large-6 offset-4 column"></h-column>
143
+ </h-row>
128
144
 
129
145
  ![Edge Grid - Offset](http://cdn.setyono.net/edge/grid-offset.jpg)
130
146
 
131
- Column Ordering
132
- -----------------
133
-
134
- push-x
135
- pull-x
136
-
137
- **Push** pushes the column to the right, while **Pull** pulls it to the left.
138
-
139
- They are ignored on small screen.
140
-
141
- **Example**:
142
-
143
- Create a sidebar that is located on the left. But if viewed with phone, it is on the bottom.
144
-
145
- <div class="row">
146
- <main class="large-8 push-4 column"></main>
147
- <aside class="large-4 pull-8 column"></aside>
148
- </div>
149
-
150
- The snippet above will look like this:
151
-
152
- ![Edge Grid - Ordering](http://cdn.setyono.net/edge/grid-ordering.jpg)
153
147
 
154
148
  GRID SYSTEM - TILE
155
149
  =================
156
150
 
157
- ul.tile-x
158
- ul.small-tile-x
151
+ <h-tile>
152
+ <h-ti>
153
+ .block-x
154
+ .small-block-x
159
155
 
160
156
  Evenly divides the list into block size.
161
157
 
162
- <ul class="tile-3 small-tile-2">
163
- <li>1</li>
164
- <li>2</li>
165
- <li>3</li>
166
- <li>4</li>
167
- <li>5</li>
168
- </ul>
158
+ <h-tile class="block-3 small-block-2">
159
+ <h-ti> 1 </h-ti>
160
+ <h-ti> 2 </h-ti>
161
+ <h-ti> 3 </h-ti>
162
+ <h-ti> 4 </h-ti>
163
+ <h-ti> 5 </h-ti>
164
+ </h-tile>
169
165
 
170
166
  ![Edge Grid - Tile](http://cdn.setyono.net/edge/grid-tile.jpg)
171
167
 
@@ -173,13 +169,13 @@ Each tile will expand 100% on small screen when the small size is not specified.
173
169
 
174
170
  Just like row, you can collapse it:
175
171
 
176
- <ul class="tile-7 collapse"> ... </ul>
172
+ <h-tile class="block-7 collapse"> ... </h-tile>
177
173
 
178
174
  **Convention**:
179
175
 
180
- - In your own stylesheet, don't name a class that contains the word "tile".
176
+ - Don't name any of your class starting with `block`. It is reserved for tile.
181
177
 
182
- - Don't add your own style to the `.tile` and `.tile > li` elements.
178
+ - Don't add your own styling to the tile or ti element.
183
179
 
184
180
  TYPOGRAPHY
185
181
  ======================
@@ -206,96 +202,6 @@ With any class
206
202
  List 2
207
203
  List 3
208
204
 
209
- If you want horizontal list, add `.inline-list` class.
210
-
211
- <ul class="inline-list">...</ul>
212
-
213
- Result:
214
- List 1 List 2 List 3
215
-
216
- VISIBILITY
217
- ==================
218
-
219
- .hide-for-<size>
220
- .show-for-<size>
221
-
222
- <size> = large / small / mini
223
-
224
- **Hide** means hidden only on that size. **Show** means visible only on that size.
225
-
226
- Sizing:
227
-
228
- - Large - above 768px
229
-
230
- - Small - below or equal to 768px
231
-
232
- - Mini - below or equal to 480px
233
-
234
- **VISIBILITY SCALE**
235
-
236
- 0-----480-----768------------->
237
-
238
- |-mini-|
239
-
240
- |----small-----|
241
-
242
- |----large----->
243
-
244
- Notice that small size includes the mini portion too.
245
-
246
- **VISIBILITY TABLE**
247
-
248
- ✓ = visible
249
-
250
- Large Small Mini
251
-
252
- .hide-for-large - ✓ ✓
253
- .hide-for-small ✓ - -
254
- .hide-for-mini ✓ ✓ -
255
-
256
- .show-for-large ✓ - -
257
- .show-for-small - ✓ ✓
258
- .show-for-mini - - ✓
259
-
260
- From the table, we can see that some classes like `.hide-for-large` and `.show-for-small` have same result. It is up to your preference on which word makes more sense.
261
-
262
- EXAMPLE
263
- --------------
264
-
265
- Sidebar hidden on mini screen
266
-
267
- <aside class="hide-for-mini"></aside>
268
-
269
- Slider visible only on large screen
270
-
271
- <div role="banner" class="show-for-large"></div>
272
- // or
273
- <div role="banner" class="hide-for-small"></div>
274
-
275
- BOILERPLATE GENERATOR
276
- ========================
277
-
278
- Generate basic template for your project. Run this command inside your project directory:
279
-
280
- 1. Static HTML
281
-
282
- `edge create html`
283
-
284
- 2. Wordpress 3.8+ (Min PHP 5.3)
285
-
286
- `edge create wordpress`
287
-
288
- 3. Ghost Blog
289
-
290
- `edge create blog`
291
-
292
- 4. Rails (run inside Rails project)
293
-
294
- `rails g edge:install`
295
-
296
- 5. Coming soon: Sinatra and Flask
297
-
298
-
299
205
  WORDPRESS
300
206
  ====================
301
207
 
@@ -319,7 +225,7 @@ Inside `functions.php`, add these codes:
319
225
 
320
226
  The icon name is taken from [melchoyce.github.io/dashicons/](http://melchoyce.github.io/dashicons/).
321
227
 
322
- Tips:
228
+ **Note**:
323
229
 
324
230
  - If you want pagination to work, the `$name` cannot be the same as any page's slug.
325
231
 
@@ -372,6 +278,47 @@ If the base size is not default, pass it as second parameter:
372
278
  }
373
279
  }
374
280
 
281
+ MEDIA QUERY - mixin
282
+ =========================
283
+
284
+ below($size)
285
+ above($size)
286
+ between($smaller-size, $larger-size)
287
+
288
+ $size = large / small / mini
289
+
290
+ **Below** means less than or equal to (`<=`).
291
+
292
+ **Above** means more than (`>`).
293
+
294
+ **Between** is inclusive to both (`>= smaller-size` and `<= larger-size`).
295
+
296
+ p {
297
+ color: black;
298
+
299
+ @include above(small) {
300
+ color: blue;
301
+ }
302
+
303
+ @include below(small) {
304
+ color: yellow;
305
+ }
306
+ }
307
+
308
+ You can use pixel too:
309
+
310
+ p {
311
+ color: black;
312
+
313
+ @include above(850px) {
314
+ color: pink;
315
+ }
316
+
317
+ @include between(300px, 400px) {
318
+ color: green;
319
+ }
320
+ }
321
+
375
322
  GRID - mixin
376
323
  ======================
377
324
 
@@ -385,49 +332,43 @@ GRID - mixin
385
332
  $small : int - The small sizing
386
333
  $mini : int - The mini sizing (below 480px)
387
334
  $offset : int
388
- $push : int
389
- $pull : int
390
- $collapse : bool
391
335
  $centered : bool
392
- $gutter : px
393
336
  $total : int - Total number of columns
394
337
 
395
338
 
396
339
  Custom grid makes the markup cleaner and easier to change.
397
340
 
398
341
  // HTML
399
- <div class="row">
400
- <aside class="column"></aside>
401
- <main class="my-col column"></main>
402
- </div>
342
+ <h-row>
343
+ <h-column class="sidebar"></h-column>
344
+ <h-column class="content"></h-column>
345
+ </h-row>
403
346
 
404
347
 
405
348
  // SCSS
406
- aside.column {
407
- @include column(2, 4, 12);
408
- // or
349
+ .sidebar {
409
350
  @include column($size: 2, $small: 4, $mini: 12);
351
+ // or
352
+ @include column(2, 4, 12);
410
353
  }
411
354
 
412
- .my-col {
355
+ .main {
413
356
  @include column(10, 8, 12);
414
- // or
415
- @include column($size: 10, $small: 8, $mini: 12);
416
357
  }
417
358
 
418
- **Convention**:
359
+ **Note**:
419
360
 
420
- - Custom column must be applied to the element that has `column` class. The same goes to custom row.
361
+ - Custom column MUST be applied to `h-column` element. The same rule goes to custom row.
421
362
 
422
363
  ### GUTTER
423
364
 
424
- Custom gutter must be applied to both row and column.
365
+ Custom gutter is applied to the row
425
366
 
426
367
  // HTML
427
- <div class="my-row row">
428
- <aside class="column"></aside>
429
- <main class="my-col column"></main>
430
- </div>
368
+ <h-row class="my-row">
369
+ <h-column class="large-3"></h-column>
370
+ <h-column class="large-9"></h-column>
371
+ </h-row>
431
372
 
432
373
 
433
374
  // SCSS
@@ -435,74 +376,53 @@ Custom gutter must be applied to both row and column.
435
376
  @include row($gutter: 50px);
436
377
  }
437
378
 
438
- aside.column {
439
- @include column($size: 2, $gutter: 50px);
440
- }
379
+ ## GUTTER on large and small
380
+
381
+ Unlike the column's sizing. There's no parameter called `small-gutter` or `mini-gutter`.
441
382
 
442
- .my-col {
443
- @include column($size: 10, $gutter: 50px);
383
+ So, the workaround is to use media query:
384
+
385
+ .my-row {
386
+ @include row($gutter: 50px);
387
+
388
+ @include below(small) {
389
+ @include row($gutter: 20px);
390
+ }
444
391
  }
445
392
 
393
+ **Note**:
394
+
395
+ - Use the same workaround for column's `offset`.
396
+
446
397
  ### COLLAPSE
447
398
 
448
- Collapse must be applied to both row and column.
399
+ Collapse is applied to the row
449
400
 
401
+ // HTML
402
+ <h-row class="my-row">
403
+ ...
404
+ </h-row>
405
+
406
+
407
+ // SCSS
450
408
  .my-row {
451
409
  @include row($collapse: true);
452
410
  }
453
411
 
454
- .my-col {
455
- @include column($size: 10, $collapse: true);
456
- }
457
-
458
412
  ### TOTAL COLUMNS
459
413
 
460
414
  You can either use `$total` parameter or fraction:
461
-
462
- .my-col {
415
+
416
+ .content {
463
417
  @include column($size: 7, $offset: 3, $total: 15);
464
418
  }
465
419
 
466
420
  // or
467
421
 
468
- .my-col {
422
+ .content {
469
423
  @include column($size: 7 / 15, $offset: 3 / 15);
470
424
  }
471
425
 
472
- GRID PIXEL *beta
473
- ===============
474
-
475
- column-px()
476
- $size : px
477
- $width : px
478
- $gutter : px
479
- $centered : boolean
480
-
481
- Let's say a designers gives you a design that doesn't follow grid system. Here's an example:
482
-
483
- ![Pre-given Design](http://cdn.setyono.net/edge/custom-total-column.jpg)
484
-
485
- With `column-px()` mixin, we can create that layout easily:
486
-
487
- // HTML
488
- <div class="my-row row">
489
- <main class="my-col column"> ... </main>
490
- <aside class="side-col column"> ... </aside>
491
- </div>
492
-
493
- // SCSS
494
- .my-row {
495
- @include row($gutter: 35px);
496
- }
497
-
498
- .my-col {
499
- @include column-px($size: 500px, $width: 735px, $gutter: 35px);
500
- }
501
-
502
- .side-col {
503
- @include column-px($size: 200px, $width: 735px, $gutter: 35px);
504
- }
505
-
506
426
  TILE - mixin
507
427
  ======================
508
428
 
@@ -515,74 +435,20 @@ TILE - mixin
515
435
 
516
436
  Mini sizing is available for tile's mixin too.
517
437
 
518
- <ul class="products"></ul>
438
+ <h-tile class="products">
439
+ ...
440
+ </h-tile>
519
441
 
520
442
  .products {
521
- @include tile($size: 7, $small: 4, $mini: 2);
522
-
523
- // or
524
-
525
443
  @include tile(7, 4, 2);
526
444
  }
527
445
 
528
- MEDIA QUERY - mixin
529
- =========================
530
-
531
- below($size)
532
- above($size)
533
- between($smaller-size, $larger-size)
534
-
535
- $size = large / small / mini
536
-
537
- **Below** means less than or equal to (`<=`).
538
-
539
- **Above** means more than (`>`).
540
-
541
- **Between** is inclusive to both (`>= smaller-size` and `<= larger-size`).
542
-
543
- p {
544
- color: black;
545
-
546
- @include above(small) {
547
- color: blue;
548
- }
549
-
550
- @include below(small) {
551
- color: yellow;
552
- }
553
- }
554
-
555
- You can use pixel too:
556
-
557
- p {
558
- color: black;
559
-
560
- @include above(850px) {
561
- color: pink;
562
- }
563
-
564
- @include between(300px, 400px) {
565
- color: green;
566
- }
567
- }
568
-
569
- VISIBILITY - mixin
570
- ========================
571
-
572
- We don't offer mixin for visibility. Use media query instead:
573
-
574
- .sidebar {
575
- @include below(small) {
576
- display: none;
577
- }
578
- }
579
-
580
446
  RAILS
581
447
  =================
582
448
 
583
449
  ![Edge Rails](http://cdn.setyono.net/edge/rails-edge.jpg)
584
450
 
585
- Gemfile:
451
+ Add this chunk to your gemfile (some already came in default Rails project):
586
452
 
587
453
  gem 'sass'
588
454
  gem 'sass-rails', '~> 4.0.0'
@@ -602,9 +468,18 @@ FAQ
602
468
 
603
469
  Edge leans toward those who create website based on designer's wireframe/mockup.
604
470
 
605
- Bootstrap and Foundation offer pre-styled elements which are great for quick prototyping. But when you are working with a designer, you won't use any of those styling.
471
+ Bootstrap and Foundation offer ready-to-use elements. Trying to match a designer's work with it will just end up in you overriding most of them. And that may result in unexpected style and bloated code.
606
472
 
607
473
  2. Is Edge a mobile-first framework?
608
474
 
609
475
  No it is not.
610
476
 
477
+ 3. What's changed from v1?
478
+
479
+ Major changes are:
480
+
481
+ - Grid and Tile now use Web Component.
482
+
483
+ - Visibility class is removed.
484
+
485
+ - Source Ordering (pull and push) is removed.