edge_framework 0.6.1 → 0.8.1

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/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in edge-style.gemspec
3
+ # Specify your gem's dependencies in edge.gemspec
4
4
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,38 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ edge_framework (0.6.1)
5
+ compass (>= 0.12.0)
6
+ sass (>= 3.2.0)
7
+ win32console
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ chunky_png (1.2.9)
13
+ compass (0.12.2)
14
+ chunky_png (~> 1.2)
15
+ fssm (>= 0.2.7)
16
+ sass (~> 3.1)
17
+ diff-lcs (1.2.4)
18
+ fssm (0.2.10)
19
+ rake (10.1.0)
20
+ rspec (2.14.1)
21
+ rspec-core (~> 2.14.0)
22
+ rspec-expectations (~> 2.14.0)
23
+ rspec-mocks (~> 2.14.0)
24
+ rspec-core (2.14.5)
25
+ rspec-expectations (2.14.2)
26
+ diff-lcs (>= 1.1.3, < 2.0)
27
+ rspec-mocks (2.14.3)
28
+ sass (3.2.13)
29
+ win32console (1.3.2-x86-mingw32)
30
+
31
+ PLATFORMS
32
+ x86-mingw32
33
+
34
+ DEPENDENCIES
35
+ bundler (~> 1.3)
36
+ edge_framework!
37
+ rake
38
+ rspec
@@ -17,34 +17,33 @@ $experimental-support-for-khtml : false;
17
17
  // -------------------------------------------------------
18
18
  // OUTPUT CONFIG
19
19
  // DEBUG:
20
- // Set to true for various useful functionality during
20
+ // Set to true for useful functionality during
21
21
  // development
22
+ // RESPONSIVE:
23
+ // Add responsiveness to the output
22
24
  // EXTERNAL CALL:
23
25
  // Add extra feature if calling Component's mixin exter-
24
26
  // -nally
25
- // RESPONSIVE:
26
- // Add responsiveness to the GRID
27
27
  // INCLUDE:
28
28
  // Set to false if you want to import the mixins only
29
29
  // -------------------------------------------------------
30
30
  $debug : false !default;
31
+ $responsive : true !default;
31
32
 
32
33
  $external-call : false !default; // user shouldn't modify this
33
34
 
34
- $responsive : true !default;
35
-
36
35
  $include-normalize : true !default;
37
36
  $include-typography : true !default;
38
37
 
39
38
  $include-grid : true !default;
40
- $include-block-grid : true !default;
39
+ $include-tile : true !default;
41
40
  $include-visibility : true !default;
42
41
 
43
42
  $include-button : true !default;
44
43
  $include-form : true !default;
45
- $include-print : true !default;
46
44
 
47
- $include-code : true !default;
45
+ $include-print : false !default;
46
+ $include-code : false !default;
48
47
 
49
48
  // ----------
50
49
  // COLOR
@@ -78,20 +77,20 @@ $body-line-height : 1.5 !default;
78
77
  // ------------------------
79
78
  // It strips the unit of measure and returns it
80
79
  @function stripUnit($num) {
81
- @return $num / ($num * 0 + 1);
80
+ @return $num / ($num * 0 + 1);
82
81
  }
83
82
 
84
83
  // Convert the number to EM
85
84
  @function convertToEm($value, $context: $body-font-size) {
86
- // If not number, return it as is
87
- @if type-of($value) != number { @return $value; }
88
-
89
- $value: stripUnit($value) / stripUnit($context) * 1em;
90
- // Turn 0em into 0
91
- @if ($value == 0em) {
92
- $value: 0;
93
- }
94
- @return $value;
85
+ // If not number, return it as is
86
+ @if type-of($value) != number { @return $value; }
87
+
88
+ $value: stripUnit($value) / stripUnit($context) * 1em;
89
+ // Turn 0em into 0
90
+ @if ($value == 0em) {
91
+ $value: 0;
92
+ }
93
+ @return $value;
95
94
  }
96
95
 
97
96
  // EXAMPLE USAGE
@@ -99,141 +98,173 @@ $body-line-height : 1.5 !default;
99
98
  // padding : em(20px 30px 15px 10px);
100
99
  // border : em(10px solid rgba(black, 0.3) );
101
100
  @function em($values, $context: $body-font-size) {
102
- // If debug mode, return it plainly
103
- @if $debug {
104
- @return $values;
105
- }
106
- // Only convert to EM on non-debug mode
107
- @else {
108
- // If the value only contain single number, return it quickly without the overhead further below
109
- @if type-of($values) == number {
110
- @return convertToEm($values, $context);
111
- }
112
-
113
- $emValues : (); // This will eventually store the converted $values in a list
114
- @each $val in $values {
115
- $emValues: append($emValues, convertToEm($val, $context) );
116
- }
117
- @return join((), $emValues, space );
118
- }
101
+ // If debug mode, return it plainly
102
+ @if $debug {
103
+ @return $values;
104
+ }
105
+ // Only convert to EM on non-debug mode
106
+ @else {
107
+ // If the value only contain single number, return it quickly without the overhead further below
108
+ @if type-of($values) == number {
109
+ @return convertToEm($values, $context);
110
+ }
111
+
112
+ $emValues : (); // This will eventually store the converted $values in a list
113
+ @each $val in $values {
114
+ $emValues: append($emValues, convertToEm($val, $context) );
115
+ }
116
+ @return join((), $emValues, space );
117
+ }
119
118
  }
120
119
 
121
120
  // -------------------
122
121
  // MEDIA QUERIES
122
+ // How to use:
123
+ // @include below(small)
124
+ // @include below(500px)
125
+ // @include above(retina)
126
+ // @include between(small, medium)
127
+
128
+ // @media only screen and #{above(small)} and #{portrait}
123
129
  // -------------------
124
- $phone-screen : 480px !default;
125
- $small-screen : 767px !default;
126
- $medium-screen : 1140px !default;
130
+ $mini-screen : 480px !default;
131
+ $small-screen : 768px !default;
127
132
  $large-screen : 1440px !default;
128
133
  $retina-screen : 192dpi !default;
129
134
 
130
- @mixin below($size) {
131
- @media only screen and (max-width: $size) { @content; }
135
+ @function translateSize($size-name) {
136
+ // If passed param is number, return it as it is
137
+ @if type-of($size-name) == number {
138
+ @return $size;
139
+ }
140
+ // Else, return the size as requested
141
+ @else if $size-name == mini {
142
+ @return $mini-screen;
143
+ }
144
+ @else if $size-name == small {
145
+ @return $small-screen;
146
+ }
147
+ @else if $size-name == large {
148
+ @return $large-screen;
149
+ }
150
+ @else if $size-name == retina {
151
+ @return $retina-screen;
152
+ }
132
153
  }
133
154
 
134
- @mixin above($size) {
135
- @media only screen and (min-width: $size) { @content; }
155
+ // Function to be used in conjunction with @media
156
+ @function below($named-size) {
157
+ $size: translateSize($named-size);
158
+ @if $size == retina {
159
+ @return "(-webkit-max-device-pixel-ratio: 2), (max-resolution: #{$size})";
160
+ }
161
+ @else {
162
+ @return "(max-width: #{$size})";
163
+ }
136
164
  }
137
165
 
138
- @mixin between($smaller-size, $large-size) {
139
- @media only screen and (min-width: $smaller-size) and (max-width: $larger-size) {
140
- @content;
141
- }
166
+ @function above($named-size) {
167
+ $size: translateSize($named-size);
168
+ @if $named-size == retina {
169
+ @return "(-webkit-min-device-pixel-ratio: 2), (min-resolution: #{$size})";
170
+ }
171
+ @else {
172
+ @return "(min-width: #{$size})";
173
+ }
142
174
  }
143
175
 
144
- // 480px and down
145
- @mixin phone() {
146
- @include below($phone-screen) { @content; }
176
+ @function between($smaller-size, $larger-size) {
177
+ $smaller-size: translateSize($smaller-size);
178
+ $larger-size: translateSize($larger-size);
179
+ @return "(min-width: #{$smaller-size}) and (max-width: #{$larger-size})";
147
180
  }
148
- // 767px and down
149
- @mixin small() {
150
- @include below($small-screen) { @content; }
151
- }
152
- // 768px and up. If you're planning to support IE8, NEVER use medium-up
153
- @mixin medium-up() {
154
- @include above($small-screen + 1px) { @content; }
181
+
182
+ @function landscape() {
183
+ @return "(orientation: landscape)";
155
184
  }
156
- // 1140px and down
157
- @mixin medium() {
158
- @include below($medium-screen) { @content; }
185
+
186
+ @function portrait() {
187
+ @return "(orientation: portrait)";
159
188
  }
160
- // large() is not needed, just put it outside media query
161
-
162
- // 2x pixel ratio
163
- @mixin retina() {
164
- @media only screen and (-webkit-min-device-pixel-ratio: 2),
165
- (min-resolution: $retina-screen) {
166
- @content;
167
- }
189
+
190
+ // Standalone mixin
191
+ @mixin below($named-size) {
192
+ $size: translateSize($named-size);
193
+ @if $named-size == retina {
194
+ @media only screen and (-webkit-max-device-pixel-ratio: 2), (max-resolution: $size) {
195
+ @content;
196
+ }
197
+ }
198
+ @else {
199
+ @media only screen and (max-width: $size) { @content; }
200
+ }
168
201
  }
169
- // Landscape orientation __
170
- @mixin landscape {
171
- @media only screen and (orientation: landscape) { @content; }
202
+
203
+ @mixin above($named-size) {
204
+ $size: translateSize($named-size);
205
+ @if $named-size == retina {
206
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), (min-resolution: $size) {
207
+ @content;
208
+ }
209
+ }
210
+ @else {
211
+ @media only screen and (min-width: $size) { @content; }
212
+ }
172
213
  }
173
- // Portrait orientation |
174
- @mixin portrait {
175
- @media only screen and (orientation: portrait) { @content; }
214
+
215
+ @mixin between($smaller-size, $larger-size) {
216
+ $smaller-size: translateSize($smaller-size);
217
+ $larger-size: translateSize($larger-size);
218
+ @media only screen and (min-width: $smaller-size) and (max-width: $larger-size) {
219
+ @content;
220
+ }
176
221
  }
177
222
 
178
223
  // ----------------------------------------------
179
224
  // CLEARING FLOAT
180
- // Make a container wraps floated element
181
- //
182
- // If you prefer readable output, use the mixin
183
- // If you prefer smaller output, use placeholder
225
+ // Make a container wraps floated element
184
226
  // ----------------------------------------------
185
- %clearfix {
186
- zoom: 1;
187
- &:before, &:after {
188
- content : " ";
189
- display : table;
190
- }
191
- &:after {
192
- clear: both;
193
- }
194
- }
195
227
  @mixin clearfix {
196
- zoom: 1;
197
- &:before, &:after {
198
- content : " ";
199
- display : table;
200
- }
201
- &:after {
202
- clear: both;
203
- }
228
+ zoom: 1;
229
+ &:before, &:after {
230
+ content: " ";
231
+ display: table;
232
+ }
233
+ &:after {
234
+ clear: both;
235
+ }
204
236
  }
205
237
 
206
-
207
238
  // --------------------------------
208
239
  // SELECTION
209
- // Change the text highlight color
240
+ // Change the text highlight color
210
241
  // --------------------------------
211
242
 
212
243
  @mixin selection($background-color:lighten($main-color, 35%), $color:white) {
213
244
  ::-moz-selection {
214
- background : $background-color;
215
- text-shadow : none !important;
216
- color : $color !important;
245
+ background: $background-color;
246
+ text-shadow: none !important;
247
+ color: $color !important;
217
248
  }
218
249
 
219
250
  ::selection {
220
- background : $background-color;
221
- text-shadow : none !important;
222
- color : $color !important;
251
+ background: $background-color;
252
+ text-shadow: none !important;
253
+ color: $color !important;
223
254
  }
224
255
  }
225
256
 
226
257
  // ------------------------------------------------------
227
258
  // DISABLE SELECTION
228
- // Prevents user to select/highlight the element's text
259
+ // Prevents user to select/highlight the element's text
229
260
  // ------------------------------------------------------
230
261
  @mixin disable-user-select {
231
- -webkit-touch-callout : none;
232
- -webkit-user-select : none;
233
- -khtml-user-select : none;
234
- -moz-user-select : none;
235
- -ms-user-select : none;
236
- user-select : none;
262
+ -webkit-touch-callout: none;
263
+ -webkit-user-select: none;
264
+ -khtml-user-select: none;
265
+ -moz-user-select: none;
266
+ -ms-user-select: none;
267
+ user-select: none;
237
268
  }
238
269
 
239
270
  // ---------------------
@@ -244,91 +275,91 @@ $default-float : left !default;
244
275
  $default-opposite : right !default;
245
276
  // No need to change this conditional statement, $text-direction variable controls it all.
246
277
  @if $text-direction == ltr {
247
- $default-float : left;
248
- $default-opposite : right;
278
+ $default-float : left;
279
+ $default-opposite : right;
249
280
  } @else {
250
- $default-float : right;
251
- $default-opposite : left;
281
+ $default-float : right;
282
+ $default-opposite : left;
252
283
  }
253
284
 
254
285
  // ----------------------------------------------------------
255
286
  // TRIANGLE
256
- // Create a triangle
287
+ // Create a triangle
257
288
  //
258
- // Don't specify the `height` to create equalateral triangle
289
+ // Don't specify the `height` to create equalateral triangle
259
290
  // ----------------------------------------------------------
260
291
  @mixin triangle($width, $direction:top, $color:$main-color, $height:false) {
261
- // If height is not specified, make the triangle equalateral
262
- @if not $height {
263
- // If normal triangle, `height` is set to half `width`
264
- @if $direction == top or
265
- $direction == right or
266
- $direction == left or
267
- $direction == bottom {
268
- $height : ($width / 2) * 1.732;
269
- }
270
- // Else if cornered triangle, `heigth` is the same as `width`
271
- @else if $direction == top-right or
272
- $direction == top-left or
273
- $direction == bottom-right or
274
- $direction == bottom-left {
275
- $height : $width;
276
- }
277
- }
278
- width : 0;
279
- height : 0;
280
- font-size : 0;
281
- line-height : 0%;
282
- border-style : solid;
283
- border-color : transparent;
284
- // Top /\
285
- @if $direction == top {
286
- border-width : 0 $width/2 $height $width/2;
287
- border-bottom-color : $color;
288
- }
289
- // Right |>
290
- @else if $direction == right {
291
- border-width : $width/2 0 $width/2 $height;
292
- border-left-color : $color;
293
- }
294
- // Bottom \/
295
- @else if $direction == bottom {
296
- border-width : $height $width/2 0 $width/2;
297
- border-top-color : $color;
298
- }
299
- // Left <|
300
- @else if $direction == left {
301
- border-width : $width/2 $height $width/2 0;
302
- border-right-color : $color;
303
- }
304
-
305
- // __
306
- // Top-right \ |
307
- // \|
308
- @else if $direction == top-right {
309
- border-width : 0 $width $height 0;
310
- border-right-color : $color;
311
- }
312
-
313
- // Bottom-right /|
314
- // /_|
315
- @else if $direction == bottom-right {
316
- border-width : 0 0 $height $width;
317
- border-bottom-color : $color;
318
- }
319
- // Bottom-left |\
320
- // |_\
321
- @else if $direction == bottom-left {
322
- border-width : $height 0 0 $width;
323
- border-left-color : $color;
324
- }
325
- // __
326
- // Top-left | /
327
- // |/
328
- @else if $direction == top-left {
329
- border-width : $height $width 0 0;
330
- border-top-color : $color;
331
- }
292
+ // If height is not specified, make the triangle equalateral
293
+ @if not $height {
294
+ // If normal triangle, `height` is set to half `width`
295
+ @if $direction == top or
296
+ $direction == right or
297
+ $direction == left or
298
+ $direction == bottom {
299
+ $height : ($width / 2) * 1.732;
300
+ }
301
+ // Else if cornered triangle, `heigth` is the same as `width`
302
+ @else if $direction == top-right or
303
+ $direction == top-left or
304
+ $direction == bottom-right or
305
+ $direction == bottom-left {
306
+ $height : $width;
307
+ }
308
+ }
309
+ width : 0;
310
+ height : 0;
311
+ font-size : 0;
312
+ line-height : 0%;
313
+ border-style : solid;
314
+ border-color : transparent;
315
+ // Top /\
316
+ @if $direction == top {
317
+ border-width : 0 $width/2 $height $width/2;
318
+ border-bottom-color : $color;
319
+ }
320
+ // Right |>
321
+ @else if $direction == right {
322
+ border-width : $width/2 0 $width/2 $height;
323
+ border-left-color : $color;
324
+ }
325
+ // Bottom \/
326
+ @else if $direction == bottom {
327
+ border-width : $height $width/2 0 $width/2;
328
+ border-top-color : $color;
329
+ }
330
+ // Left <|
331
+ @else if $direction == left {
332
+ border-width : $width/2 $height $width/2 0;
333
+ border-right-color : $color;
334
+ }
335
+
336
+ // __
337
+ // Top-right \ |
338
+ // \|
339
+ @else if $direction == top-right {
340
+ border-width : 0 $width $height 0;
341
+ border-right-color : $color;
342
+ }
343
+
344
+ // Bottom-right /|
345
+ // /_|
346
+ @else if $direction == bottom-right {
347
+ border-width : 0 0 $height $width;
348
+ border-bottom-color : $color;
349
+ }
350
+ // Bottom-left |\
351
+ // |_\
352
+ @else if $direction == bottom-left {
353
+ border-width : $height 0 0 $width;
354
+ border-left-color : $color;
355
+ }
356
+ // __
357
+ // Top-left | /
358
+ // |/
359
+ @else if $direction == top-left {
360
+ border-width : $height $width 0 0;
361
+ border-top-color : $color;
362
+ }
332
363
  }
333
364
 
334
365
  // ------------------------------------------------
@@ -336,12 +367,12 @@ $default-opposite : right !default;
336
367
  // for property that is not supported by Compass
337
368
  // ------------------------------------------------
338
369
  @mixin css3($property, $value,
339
- $moz : $experimental-support-for-mozilla,
340
- $webkit : $experimental-support-for-webkit,
341
- $o : $experimental-support-for-opera,
342
- $ms : $experimental-support-for-microsoft,
343
- $khtml : $experimental-support-for-khtml,
344
- $official : true) {
370
+ $moz : $experimental-support-for-mozilla,
371
+ $webkit : $experimental-support-for-webkit,
372
+ $o : $experimental-support-for-opera,
373
+ $ms : $experimental-support-for-microsoft,
374
+ $khtml : $experimental-support-for-khtml,
375
+ $official : true) {
345
376
 
346
377
  @if $webkit { -webkit-#{$property}: $value; }
347
378
  @if $khtml { -khtml-#{$property}: $value; }