edge_framework 0.9.0 → 0.9.9

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 (37) hide show
  1. data/README.md +6 -10
  2. data/assets/js/edge/edge.animate.js +0 -0
  3. data/assets/sass/edge/_base.scss +34 -22
  4. data/assets/sass/edge/_components.scss +5 -4
  5. data/assets/sass/edge/_helpers.scss +2 -14
  6. data/assets/sass/edge/components/_animate.scss +151 -0
  7. data/assets/sass/edge/components/_button.scss +98 -41
  8. data/assets/sass/edge/components/_code.scss +170 -166
  9. data/assets/sass/edge/components/_form.scss +77 -76
  10. data/assets/sass/edge/components/_grid.scss +15 -12
  11. data/assets/sass/edge/components/_normalize.scss +60 -59
  12. data/assets/sass/edge/components/_print.scss +73 -70
  13. data/assets/sass/edge/components/_tile.scss +24 -10
  14. data/assets/sass/edge/components/_typography.scss +127 -138
  15. data/assets/sass/edge/components/_visibility.scss +156 -44
  16. data/assets/sass/edge/helpers/_sprites.scss +75 -63
  17. data/assets/sass/edge/helpers/_sticky-footer.scss +26 -31
  18. data/assets/sass/edge.scss +1 -1
  19. data/assets/sass/for-test.scss +247 -151
  20. data/assets/test.html +323 -11
  21. data/edge.gemspec +17 -18
  22. data/lib/edge/engine.rb +19 -0
  23. data/lib/edge/message.rb +32 -29
  24. data/lib/edge/sprockets.rb +4 -0
  25. data/lib/edge/version.rb +2 -2
  26. data/lib/edge_framework.rb +63 -67
  27. data/template/base/assets/js/app.js +1 -1
  28. data/template/base/assets/sass/_setting.scss +35 -35
  29. data/template/base/config.rb +1 -1
  30. data/template/html/index.html +3 -3
  31. data/template/php/partials/footer.php +2 -2
  32. data/template/wordpress/footer.php +2 -3
  33. metadata +8 -24
  34. data/assets/sass/edge/components/_block-grid-margin.scss +0 -112
  35. data/assets/sass/edge/components/_grid-margin.scss +0 -309
  36. data/assets/sass/edge/components/_grid-old.scss +0 -287
  37. data/lib/edge/console.rb +0 -15
@@ -1,8 +1,11 @@
1
+ // ==================
2
+ // EDGE TYPOGRAPHY
3
+ // ==================
4
+
1
5
  // BODY
2
6
  $body-background : #fff !default;
3
7
  $body-font-color : #222 !default;
4
- $body-font-weight : normal !default;
5
- $body-font-style : normal !default;
8
+ $body-font-weight : 400 !default;
6
9
 
7
10
  // Compass' VERTICAL RHYTM
8
11
  // note: variable for $body-font-size and $body-line-height is in _base.scss due to it being used in em conversion
@@ -34,172 +37,158 @@ $ul-child-style : circle !default;
34
37
  $ol-parent-style : decimal !default;
35
38
  $ol-child-style : lower-alpha !default;
36
39
 
37
- @mixin vertical-rhythm($font-size:$base-font-size, $line-height:1.5) {
38
- $base-font-size : $font-size;
39
- $base-line-height : $font-size * $line-height;
40
-
41
- font-size : em($font-size);
42
- line-height : $line-height;
43
-
44
- h1 { @include adjust-font-size-to($h1-font-size); @include adjust-leading-to(2, $h1-font-size); }
45
- h2 { @include adjust-font-size-to($h2-font-size); }
46
- h3 { @include adjust-font-size-to($h3-font-size); }
47
- h4 { @include adjust-font-size-to($h4-font-size); }
48
- h5 { @include adjust-font-size-to($h5-font-size); }
49
- h6 { @include adjust-font-size-to($h6-font-size); }
50
-
51
- p {
52
- @include trailer(1);
53
- &:last-child {
54
- @include trailer(0);
55
- }
56
- + ul,
57
- + ol {
58
- @include trailer(1);
59
- }
60
- }
40
+ // ------------------------------------------------
41
+ // VERTICAL RHYTHM
42
+ // - Apply vertically-aligned paragraph and header
43
+ // ------------------------------------------------
44
+ @mixin vertical-rhythm(
45
+ $font-size : $base-font-size,
46
+ $line-height : $base-line-height,
47
+ $for-base : false) {
48
+
49
+ $base-font-size : $font-size;
50
+ $base-line-height : $font-size * $line-height;
51
+
52
+ @if not $for-base {
53
+ font-size: em($font-size);
54
+ line-height: $line-height;
55
+ }
56
+
57
+ h1 { @include adjust-font-size-to($h1-font-size); }
58
+ h2 { @include adjust-font-size-to($h2-font-size); }
59
+ h3 { @include adjust-font-size-to($h3-font-size); }
60
+ h4 { @include adjust-font-size-to($h4-font-size); }
61
+ h5 { @include adjust-font-size-to($h5-font-size); }
62
+ h6 { @include adjust-font-size-to($h6-font-size); }
63
+
64
+ p {
65
+ @include trailer(1);
66
+
67
+ &:last-child,
68
+ &:last-of-type {
69
+ @include trailer(0);
70
+ }
71
+
72
+ + ul,
73
+ + ol {
74
+ @include trailer(1);
75
+ }
76
+ }
61
77
  }
62
78
 
63
- @mixin baseline($font-size:$base-font-size, $line-height:1.5) {
64
- @include background(
65
- linear-gradient(to bottom, rgba(black, 0) 95%, rgba(black, .3) 100%)
66
- );
67
- background-size: 100% em($font-size * $line-height, $font-size);
79
+ // ------------------------------
80
+ // BASELINE
81
+ // - Create notebook-like row
82
+ // ------------------------------
83
+ @mixin baseline(
84
+ $font-size : $base-font-size,
85
+ $line-height : $base-line-height) {
86
+
87
+ @include background(
88
+ linear-gradient(to bottom, rgba(black, 0) 95%, rgba(black, .3) 100%)
89
+ );
90
+ background-size: 100% em($font-size * $line-height, $font-size);
68
91
  }
69
92
 
70
- @if $include-typography {
93
+ @if $include-typography and not $external-call {
71
94
 
72
- /* ------------------
73
- EDGE Typography
74
- --------------------- */
95
+ /* -----------------
96
+ EDGE Typography
97
+ ----------------- */
75
98
 
76
99
  body {
77
- position: relative;
78
- background: $body-background;
79
- font-size: $base-font-size;
80
- font-family: $body-font-family;
81
- font-weight: $body-font-weight;
82
- font-style: $body-font-style;
83
- line-height: $base-line-height;
84
- color: $body-font-color;
100
+ position: relative;
101
+ background: $body-background;
102
+ font-size: $base-font-size;
103
+ font-family: $body-font-family;
104
+ font-weight: $body-font-weight;
105
+ line-height: $base-line-height;
106
+ color: $body-font-color;
85
107
  }
86
108
 
87
109
  .baseline {
88
- @include baseline();
110
+ @include baseline();
89
111
  }
90
112
 
91
113
  h1, h2, h3, h4, h5, h6 {
92
- color: $header-font-color;
93
- font-family: $header-font-family;
94
- font-weight: $header-font-weight;
114
+ color: $header-font-color;
115
+ font-family: $header-font-family;
116
+ font-weight: $header-font-weight;
117
+ }
118
+
119
+ a {
120
+ color: $main-color;
95
121
  }
96
122
 
97
- h1 { font-size: em($h1-font-size); }
98
- h2 { font-size: em($h2-font-size); }
99
- h3 { font-size: em($h3-font-size); }
100
- h4 { font-size: em($h4-font-size); }
101
- h5 { font-size: em($h5-font-size); }
102
- h6 { font-size: em($h6-font-size); }
103
-
104
- p {
105
- margin-top: 0;
106
- margin-bottom: $p-margin-bottom;
107
- &:last-child {
108
- margin-bottom: 0;
109
- }
123
+ @if $vertical-rhythm {
124
+ @include vertical-rhythm($for-base: true);
125
+ }
126
+ @else {
127
+ h1 { font-size: em($h1-font-size); }
128
+ h2 { font-size: em($h2-font-size); }
129
+ h3 { font-size: em($h3-font-size); }
130
+ h4 { font-size: em($h4-font-size); }
131
+ h5 { font-size: em($h5-font-size); }
132
+ h6 { font-size: em($h6-font-size); }
133
+
134
+ p {
135
+ margin-top: 0;
136
+ margin-bottom: $p-margin-bottom;
137
+
138
+ &:last-child {
139
+ margin-bottom: 0;
140
+ }
141
+
142
+ + ul,
143
+ + ol {
144
+ margin-bottom: $p-margin-bottom;
145
+ }
146
+ }
110
147
  }
111
148
 
112
- ul, ol {
113
- list-style-type: none; // Clear bullet or numbering on plain <ul>
149
+ // -----------
150
+ // LIST
151
+ // -----------
114
152
 
115
- &.inline-list {
116
- @include clearfix();
153
+ .inline-list {
154
+ @include clearfix();
117
155
 
118
- > li {
119
- display: inline-block;
120
- float: left;
121
- vertical-align: top;
122
- }
123
- }
156
+ > li {
157
+ display: inline-block;
158
+ float: left;
159
+ vertical-align: top;
160
+ }
124
161
  }
125
162
 
126
- ul.bullet-list, ol {
127
- position: relative;
128
- counter-reset: ul-counter;
129
- padding-left: em(30px);
130
- margin-bottom: $p-margin-bottom;
131
-
132
- > li:before {
133
- position: absolute;
134
- left: 0;
135
- content: counter(ul-counter, $ul-parent-style);
136
- counter-increment: ul-counter;
137
- }
138
-
139
- ul.bullet-list {
140
- margin-bottom: 0;
141
- > li:before {
142
- content: counter(ul-counter, $ul-child-style);
143
- }
144
- }
163
+ ul {
164
+ list-style-type: $ul-parent-style;
165
+ padding-left: 20px;
166
+
167
+ &[class] {
168
+ list-style-type: none;
169
+ padding-left: 0;
170
+ }
171
+
172
+ ul {
173
+ list-style-type: $ul-child-style;
174
+ }
145
175
  }
146
176
 
147
177
  ol {
148
- > li:before {
149
- content: counter(ul-counter, $ol-parent-style) ".";
150
- }
151
- ol {
152
- margin-bottom: 0;
153
- > li:before {
154
- content: counter(ul-counter, $ol-child-style) ".";
155
- }
156
- }
157
- }
178
+ list-style-type: $ol-parent-style;
179
+ padding-left: 25px;
158
180
 
159
- // ol {
160
- // position: relative;
161
- // counter-reset: ol-counter;
162
-
163
- // li:before {
164
- // position: absolute;
165
- // left: 0;
166
- // content: counter(ol-counter, $ol-parent-style);
167
- // counter-increment: ol-counter;
168
- // }
169
- // }
170
-
171
- .counter-bullet {
172
- position: relative;
173
- counter-reset: my-counter;
174
- padding-left: em(30px);
175
-
176
- li:before {
177
- position: absolute;
178
- left: 0;
179
- content: counter(my-counter, disc);
180
- counter-increment: my-counter;
181
- }
182
- }
183
- .counter-number {
184
- position: relative;
185
- counter-reset: my-counter;
186
- padding-left: em(30px);
187
-
188
- li {
189
- line-height: 1.5;
190
- }
191
-
192
- li:before {
193
- position: absolute;
194
- left: 0;
195
- content: counter(my-counter, decimal);
196
- counter-increment: my-counter;
197
- }
181
+ ol {
182
+ list-style-type: $ol-child-style;
183
+ }
198
184
  }
199
185
 
200
186
  blockquote {
187
+ margin-bottom: $p-margin-bottom;
188
+
201
189
  cite {
202
190
  display: block;
191
+ font-style: italic;
203
192
  }
204
193
  }
205
194
 
@@ -1,53 +1,165 @@
1
+ // ==================
2
+ // EDGE VISIBILITY
3
+ // ==================
4
+
5
+ // -------------
6
+ // VISIBLE ON
7
+ // - Set the display of special element
8
+ // ------------------------------------
1
9
  @mixin visible-on($size, $display: inherit) {
2
- @if $size == large {
3
- &.hide-for-large { display: $display !important; }
4
- } @else if $size == small {
5
- &.hide-for-small { display: $display !important; }
6
- }
10
+ @if $size == large {
11
+ &.hide-for-large,
12
+ &.show-for-small,
13
+ &.show-for-mini { display: none !important; }
14
+
15
+ &.hide-for-small,
16
+ &.hide-for-mini,
17
+ &.show-for-large { display: $display !important; }
18
+ }
19
+ @else if $size == small {
20
+ &.hide-for-small,
21
+ &.show-for-large { display: none !important; }
22
+
23
+ &.show-for-small,
24
+ &.hide-for-large { display: $display !important; }
25
+ }
26
+ @else if $size == mini {
27
+ &.hide-for-mini,
28
+ &.show-for-small { display: none !important; }
29
+
30
+ &.show-for-mini { display: $display !important; }
31
+ }
7
32
  }
8
33
 
9
- // Elements that need special `display`
34
+ // ---------------------------------
35
+ // SPECIAL DISPLAY
36
+ // - Elements that needs special display style
37
+ // --------------------------------------------
10
38
  @mixin special-display($size) {
11
- table {
12
- @include visible-on($size, table);
13
- }
14
- thead {
15
- @include visible-on($size, table-header-group);
16
- }
17
- tbody {
18
- @include visible-on($size, table-row-group);
19
- }
20
- tr {
21
- @include visible-on($size, table-row);
22
- }
23
- td, th {
24
- @include visible-on($size, table-cell);
25
- }
26
- span, b, em, strong, .bold, .italic, code {
27
- @include visible-on($size, inline-block);
28
- }
29
- }
30
-
31
- @if $include-visibility {
32
-
33
- /* ---------------
34
- EDGE Visibility
35
- --------------- */
36
-
37
- /* Above small breakpoint (>#{$small-screen}) */
38
- .hide-for-large { display: none !important; }
39
- @include above(small) {
40
- .hide-for-small { display: inherit !important; }
41
- @include special-display(small);
42
- }
43
-
44
-
45
- /* Below small breakpoint (<=#{$small-screen}) */
39
+ table {
40
+ @include visible-on($size, table);
41
+ }
42
+ thead {
43
+ @include visible-on($size, table-header-group);
44
+ }
45
+ tbody {
46
+ @include visible-on($size, table-row-group);
47
+ }
48
+ tr {
49
+ @include visible-on($size, table-row);
50
+ }
51
+ td, th {
52
+ @include visible-on($size, table-cell);
53
+ }
54
+ span, b, em, strong, .bold, .italic {
55
+ @include visible-on($size, inline-block);
56
+ }
57
+ }
58
+
59
+ // ---------------------------------
60
+ // HIDE FOR
61
+ // - Hide the element on that screen size
62
+ // - hide-for(small) is still hidden on mini
63
+ // ------------------------------------------
64
+ @mixin hide-for($size) {
65
+ @if $size == large {
66
+ @include above(small) {
67
+ display: none;
68
+ }
69
+ }
70
+
71
+ @else if $size == small {
72
+ @include below(small) {
73
+ display: none;
74
+ }
75
+ }
76
+
77
+ @else if $size == mini {
78
+ @include below(mini) {
79
+ display: none;
80
+ }
81
+ }
82
+ }
83
+
84
+ // ---------------------------------
85
+ // SHOW FOR
86
+ // - Show the element only on that size
87
+ // - show-for(small) is still visible on mini
88
+ // -------------------------------------------
89
+ @mixin show-for($size) {
90
+ @if $size == large {
91
+ @include below(small) {
92
+ display: none;
93
+ }
94
+ }
95
+
96
+ @else if $size == small {
97
+ @include above(small) {
98
+ display: none;
99
+ }
100
+ }
101
+
102
+ @else if $size == mini {
103
+ @include above(mini) {
104
+ display: none;
105
+ }
106
+ }
107
+ }
108
+
109
+ @if $include-visibility and not $external-call {
110
+
111
+ /* -----------------
112
+ EDGE Visibility
113
+ ----------------- */
114
+
115
+ .hide-for-large,
116
+ .show-for-small,
117
+ .show-for-mini {
118
+ display: none !important;
119
+ }
120
+
121
+ .hide-for-small,
122
+ .hide-for-mini,
123
+ .show-for-large {
124
+ display: inherit !important;
125
+ }
126
+
127
+ @include special-display(large);
128
+
46
129
  @include below(small) {
47
- .hide-for-small { display: none !important; }
48
- .hide-for-large { display: inherit !important; }
49
- @include special-display(large);
130
+ // .hide-for-mini VISIBLE
131
+ // .show-for-mini NONE
132
+
133
+ .hide-for-small,
134
+ .show-for-large {
135
+ display: none !important;
136
+ }
137
+
138
+ .show-for-small,
139
+ .hide-for-large {
140
+ display: inherit !important;
141
+ }
142
+
143
+ @include special-display(small);
50
144
  }
51
145
 
146
+ @include below(mini) {
147
+ // .hide-for-large VISIBLE
148
+ // .show-for-large NONE
149
+ // .hide-for-small NONE
150
+
151
+ .hide-for-mini,
152
+ .show-for-small {
153
+ display: none !important;
154
+ }
155
+
156
+ .show-for-mini {
157
+ display: inherit !important;
158
+ }
159
+
160
+ @include special-display(mini);
52
161
  }
53
162
 
163
+
164
+ } // include-visibility
165
+
@@ -4,80 +4,92 @@
4
4
  // - Image's type must be PNG
5
5
  // - Image's name can't start with number or contains special symbol like `@`
6
6
  //
7
- // - In your config.rb, add `relative_assets = true`
8
- // - If you use 3rd party precompiler like Prepros,
9
- // don't forget to tick the `Full Compass Support`
10
- //
11
7
  // Special Thanks:
12
8
  // www.gayadesign.com/diy/retina-sprites-for-compass
13
9
  // -----------------------------------------------------
14
10
 
11
+
12
+ // --------------------------
13
+ // Loop through sprite-map
14
+ // --------------------------
15
+ @mixin loop-sprite-map(
16
+ $map,
17
+ $is-retina : false ,
18
+ $prefix : "") {
19
+
20
+ $divide-by : 1; // for retina sprites' scaling
21
+ $sprite-url : "";
22
+
23
+ @if $is-retina {
24
+ $divide-by : 2;
25
+ $sprite-url : sprite-url($map);
26
+ }
27
+
28
+ @each $i in sprite_names($map) {
29
+ &.#{$prefix}#{$i} {
30
+
31
+ // It makes sure that if the sprite doesn't exist in Retina folder,
32
+ // it uses sprite from the Standard one.
33
+ @if $is-retina {
34
+ background: $sprite-url;
35
+ background-size:
36
+ (image-width(sprite-path($map)) / 2)
37
+ (image-height(sprite-path($map)) / 2);
38
+ }
39
+ background-position:
40
+ round(nth(sprite-position($map, $i), 1) / $divide-by)
41
+ round(nth(sprite-position($map, $i), 2) / $divide-by);
42
+ height : image-height(sprite-file($map, $i)) / $divide-by;
43
+ width : image-width(sprite-file($map, $i)) / $divide-by;
44
+ }
45
+ }
46
+ }
47
+
48
+ // --------------------------
15
49
  // Generate standard sprites
50
+ // --------------------------
16
51
  @mixin sprite(
17
- $folder-name : "sprites",
18
- $main-class : "sprite",
19
- $prefix-class : "") {
20
- $sprites: sprite-map("#{$folder-name}/*.png", $layout: smart);
21
- .#{$main-class}{
22
- background : $sprites;
23
- display : inline-block;
24
- @include loop-sprite-map($sprites, false, $prefix-class);
52
+ $folder : "sprites",
53
+ $class : "sprite",
54
+ $prefix : "") {
25
55
 
26
- @content; // placeholder for retina sprites
27
- }
56
+ $sprites: sprite-map("#{$folder}/*.png", $layout: smart);
57
+
58
+ .#{$class} {
59
+ background: $sprites;
60
+ display: inline-block;
61
+ @include loop-sprite-map($sprites, false, $prefix);
62
+
63
+ @content; // placeholder for retina sprites
64
+ }
28
65
  }
29
66
 
67
+ // ---------------------------------------------
30
68
  // Generate both Retina and Standard sprites
31
69
  // - Folder's name for Retina must be EXACT SAME as Standard one with the addition of `@2x`
32
70
  // - Image's name must be EXACT SAME for standard and retina
33
- @mixin sprite-retina($folder-name : 'sprites',
34
- $main-class : 'sprite',
35
- $prefix-class : '') {
36
-
37
- @include sprite($folder-name, $main-class, $prefix-class) {
38
- $sprites : sprite-map("#{$folder-name}/*.png", $layout: smart);
39
- $sprites-2x : sprite-map("#{$folder-name}@2x/*.png", $layout: smart);
40
- @include retina {
41
- // If all images in Retina and Standard folder is the same
42
- @if length(sprite_names($sprites) ) == length(sprite_names($sprites-2x) ) {
43
- background: $sprites-2x;
44
- background-size:
45
- (image-width(sprite-path($sprites-2x)) / 2)
46
- (image-height(sprite-path($sprites-2x)) / 2);
47
- }
48
- // If there's missing images in retina folder
49
- @else {
50
- @include loop-sprite-map($sprites-2x, true, $prefix-class);
51
- }
52
- }
53
- }
54
- }
55
-
56
-
57
- // Helper for looping through sprite-map
58
- @mixin loop-sprite-map($sprite-map, $is-retina: false , $prefix-class: '') {
59
- $divide-by : 1; // for retina sprites' scaling
60
- $sprite-url : '';
61
- @if $is-retina {
62
- $divide-by : 2;
63
- $sprite-url : sprite-url($sprite-map);
64
- }
71
+ // ----------------------------------------------------------
72
+ @mixin sprite-retina(
73
+ $folder : "sprites",
74
+ $class : "sprite",
75
+ $prefix : "") {
65
76
 
66
- @each $i in sprite_names($sprite-map) {
67
- &.#{$prefix-class}#{$i} {
68
- @if $is-retina {
69
- // It makes sure that if the sprite doesn't exist in Retina folder,
70
- // it uses sprite from the Standard one.
71
- background: $sprite-url;
72
- background-size:
73
- (image-width(sprite-path($sprite-map)) / 2)
74
- (image-height(sprite-path($sprite-map)) / 2);
75
- }
76
- background-position:
77
- round(nth(sprite-position($sprite-map, $i), 1) / $divide-by)
78
- round(nth(sprite-position($sprite-map, $i), 2) / $divide-by);
79
- height : image-height(sprite-file($sprite-map, $i)) / $divide-by;
80
- width : image-width(sprite-file($sprite-map, $i)) / $divide-by;
81
- }
82
- }
77
+ @include sprite($folder, $class, $prefix) {
78
+ $sprites : sprite-map("#{$folder}/*.png", $layout: smart);
79
+ $sprites-2x : sprite-map("#{$folder}@2x/*.png", $layout: smart);
80
+
81
+ @include below(retina) {
82
+ // If all images in Retina and Standard folder is the same
83
+ @if length(sprite_names($sprites) ) == length(sprite_names($sprites-2x) ) {
84
+ background: $sprites-2x;
85
+ background-size:
86
+ (image-width(sprite-path($sprites-2x)) / 2)
87
+ (image-height(sprite-path($sprites-2x)) / 2);
88
+ }
89
+ // If there's missing images in retina folder
90
+ @else {
91
+ @include loop-sprite-map($sprites-2x, true, $prefix-class);
92
+ }
93
+ }
94
+ }
83
95
  }