ezy 0.2.0.alpha → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ecc5a657ba9ce7ab7a6b85269db4ff0ca3f8ffe9
4
+ data.tar.gz: 8f348367ead3da3f9165770262ffd30dfb24e45d
5
+ SHA512:
6
+ metadata.gz: dba7608afd2431e094919d09201ea90044dcabde24febff0fe8cdacb05b10c0dedd287073b047c1dc8ae0e3875a66c285a056622d8e35a8ec6d97ac8c7ab69cc
7
+ data.tar.gz: 0c5d73d8dc8f025b14488a25532c89dd71c161583f2ce81809a5cb939d7b593dd47cb7f677463ab857b6bcdabaad0c3e1fc6315bd637614022f0c88114278e26
data/README.md CHANGED
@@ -3,97 +3,12 @@ Ezy: The developer's toolbox for responsive websites
3
3
 
4
4
  My attempt to create a collection of simple-to-use grid helpers and other tools with SCSS and Ruby
5
5
 
6
- Installing Ezy
7
- --------------
6
+ > NOTE: Ezy is now in beta, with only sprites out-of-the-box.
7
+ > Stand by for release of the grid.
8
8
 
9
- #### 1) Install the gem
9
+ > If you can't wait, you can check out the progress [here](https://github.com/raahede/ezy/tree/grid-alpha).
10
10
 
11
- `gem install ezy`
11
+ Documentation
12
+ -------------
12
13
 
13
- #### 2) Require Ezy in your config.rb
14
-
15
- `require "ezy"`
16
-
17
- #### 3) Import the part you need in your SCSS
18
-
19
- Import all features:
20
-
21
- `@import "ezy";`
22
-
23
- Import sprites only:
24
-
25
- `@import "ezy/sprites";`
26
-
27
- Using Ezy
28
- ---------
29
-
30
- ### Sprites
31
-
32
- #### 1) Create sprite
33
-
34
- Simple use without retina:
35
-
36
- @include make-sprite(
37
- $name: "icons", // (required) your name to use when calling sprites
38
- $folder: "icon-images" // (required) folder path relative to image folder
39
- );
40
-
41
- Simple use with retina:
42
-
43
- @include make-sprite(
44
- $name: "icons", // (required) your name to use when calling sprites
45
- $folder: "icon-images", // (required) folder path relative to image folder
46
- $folder-retina: "icon-images@2x" // (optional) folder path relative to image folder
47
- );
48
-
49
- Advanced use:
50
-
51
- @include make-sprite(
52
- $name: "icons", // (required) your name to use when calling sprites
53
- $folder: "icon-images", // (required) folder path relative to image folder
54
- $folder-retina: "icon-images@2x", // (optional) folder path relative to image folder
55
- $spacing: 20px, // (optional) [default: 0px] spacing between images in compiled sprite
56
- $layout: vertical, // (optional) [default: vertical] vertical, horizontal, diagonal
57
- $position: 0%, // (optional) [default: 0%] alignment of images in the sprite
58
- $spacing-retina: 40px, // (optional) [default: $spacing x 2]
59
- $layout-retina: diagonal, // (optional) [default: $layout]
60
- $position-retina: 100% // (optional) [default: $position]
61
- );
62
-
63
- #### 2) Use sprite
64
-
65
- Simple use: (if a sprite has a retina version, it uses retina as a default)
66
-
67
- .icon-git-fork {
68
- @include background-sprite( "icons", "git-fork" ); // using image git-fork.png from images/icon-images/
69
- }
70
-
71
- Simple use, force no retina:
72
-
73
- .icon-git-fork {
74
- @include background-sprite( "icons", "git-fork", $use-retina: false );
75
- }
76
-
77
- Advanced use:
78
-
79
- .icon-git-fork {
80
- @include background-sprite(
81
- $name: "icons", // (required) sprite name
82
- $image: "git-fork", // (required) image to use
83
- $offset-x: 10px, // (optional) [default: 0] background offset x
84
- $offset-y: 20px, // (optional) [default: 0] background offset y
85
- $use-retina: true // (optional) [default: true] wether to use retina on hi-res screens
86
- );
87
- }
88
-
89
- Building and testing local gem
90
- ------------------------------
91
-
92
- #### Build gem ###
93
- `gem build ezy.gemspec`
94
-
95
- #### Install local gem ###
96
- `gem install --local ezy-[build version].gem`
97
-
98
- #### Open installed gem location (Mac) ###
99
- `open /Users/[username]/.rvm/gems/`
14
+ View documentation here: [raahede.github.io/ezy](http://raahede.github.io/ezy/)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0.alpha
1
+ 0.2.0
data/ezy.gemspec CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  # Release Specific Information
5
- s.version = "0.2.0.alpha"
6
- s.date = "2013-11-13"
5
+ s.version = "0.2.0"
6
+ s.date = "2013-12-08"
7
7
 
8
8
  # Gem Details
9
9
  s.name = "ezy"
@@ -19,7 +19,9 @@ Gem::Specification.new do |s|
19
19
  s.files += %w(ezy.gemspec)
20
20
  s.files += %w(VERSION)
21
21
  s.files += Dir.glob("lib/**/*.*")
22
- s.files += Dir.glob("sass/**/*.*")
22
+ # s.files += Dir.glob("sass/**/*.*")
23
+ s.files += Dir.glob("sass/_ezy.scss")
24
+ s.files += Dir.glob("sass/ezy/_sprites.scss")
23
25
  s.files += Dir.glob("templates/**/*.*")
24
26
  s.files += Dir.glob("test/config.rb")
25
27
  s.files += Dir.glob("test/css/**/*.*")
@@ -31,4 +33,4 @@ Gem::Specification.new do |s|
31
33
  s.rubygems_version = %q{1.3.6}
32
34
  s.add_dependency(%q<compass>, [">= 0.12.2"])
33
35
  s.add_dependency(%q<sass>, [">= 3.2.0"])
34
- end
36
+ end
data/sass/_ezy.scss CHANGED
@@ -1,6 +1,6 @@
1
1
  // ---------------------------------------------------------------------------
2
2
  // Partials
3
3
 
4
- @import "ezy/media";
5
- @import "ezy/grid";
4
+ // @import "ezy/media";
5
+ // @import "ezy/grid";
6
6
  @import "ezy/sprites";
@@ -8,9 +8,10 @@
8
8
  // https://github.com/chriseppstein/compass/issues/897
9
9
 
10
10
  // ---------------------------------------------------------------------------
11
- // Global variable for device pixel ratio
11
+ // Setting defaults
12
12
 
13
13
  $min-device-pixel-ratio: 2 !default;
14
+ $legacy-selector: ".no-media-queries" !default;
14
15
 
15
16
  // ---------------------------------------------------------------------------
16
17
  // Sprite map store
@@ -159,18 +160,34 @@ $sprite-maps: ();
159
160
  //
160
161
  // Retina media query mixin
161
162
 
162
- @mixin at-retina( $ratio: 2 ) {
163
- @media
164
- only screen and (-webkit-min-device-pixel-ratio: #{ $ratio }),
165
- only screen and ( min--moz-device-pixel-ratio: #{ $ratio }),
166
- only screen and ( -moz-min-device-pixel-ratio: #{ $ratio }),
167
- only screen and ( -ms-min-device-pixel-ratio: #{ $ratio }),
168
- only screen and ( -o-min-device-pixel-ratio: #{ $ratio }/1),
169
- only screen and ( min-device-pixel-ratio: #{ $ratio }),
170
- only screen and ( min-resolution: #{ $ratio * 96 }dpi),
171
- only screen and ( min-resolution: #{ $ratio }dppx) {
172
- @content;
163
+ @mixin at-retina( $ratio: 2, $query: false ) {
164
+ @if $query {
165
+ // Extending retina media query with breakpoint query
166
+ @media
167
+ only screen and (-webkit-min-device-pixel-ratio: #{ $ratio }) and #{ $query },
168
+ only screen and ( min--moz-device-pixel-ratio: #{ $ratio }) and #{ $query },
169
+ only screen and ( -moz-min-device-pixel-ratio: #{ $ratio }) and #{ $query },
170
+ only screen and ( -ms-min-device-pixel-ratio: #{ $ratio }) and #{ $query },
171
+ only screen and ( -o-min-device-pixel-ratio: #{ $ratio }/1) and #{ $query },
172
+ only screen and ( min-device-pixel-ratio: #{ $ratio }) and #{ $query },
173
+ only screen and ( min-resolution: #{ $ratio * 96 }dpi) and #{ $query },
174
+ only screen and ( min-resolution: #{ $ratio }dppx) and #{ $query } {
175
+ @content;
176
+ }
177
+ } @else {
178
+ @media
179
+ only screen and (-webkit-min-device-pixel-ratio: #{ $ratio }),
180
+ only screen and ( min--moz-device-pixel-ratio: #{ $ratio }),
181
+ only screen and ( -moz-min-device-pixel-ratio: #{ $ratio }),
182
+ only screen and ( -ms-min-device-pixel-ratio: #{ $ratio }),
183
+ only screen and ( -o-min-device-pixel-ratio: #{ $ratio }/1),
184
+ only screen and ( min-device-pixel-ratio: #{ $ratio }),
185
+ only screen and ( min-resolution: #{ $ratio * 96 }dpi),
186
+ only screen and ( min-resolution: #{ $ratio }dppx) {
187
+ @content;
188
+ }
173
189
  }
190
+
174
191
  }
175
192
 
176
193
  // ---------------------------------------------------------------------------
@@ -220,15 +237,15 @@ $sprite-maps: ();
220
237
  $clean-up: $clean-up-retina
221
238
  );
222
239
  }
240
+ $sprite-settings: $name $sprite $sprite-retina $position $position-retina $repeat $repeat-retina;
223
241
  @if $sprite-maps == () {
224
- $sprite-maps: ($name $sprite $sprite-retina $position $position-retina $repeat $repeat-retina);
242
+ $sprite-maps: ($sprite-settings);
225
243
  } @else {
226
- $sprite-maps: $sprite-maps, ($name $sprite $sprite-retina $position $position-retina $repeat $repeat-retina);
244
+ $sprite-maps: $sprite-maps, ($sprite-settings);
227
245
  }
228
246
  %sprite-placeholder-#{ $name } {
229
247
  background-image: sprite-url( $sprite );
230
248
  background-repeat: $repeat;
231
- // background-position-x: $position;
232
249
  }
233
250
  %sprite-placeholder-#{ $name }-retina {
234
251
  @if $sprite-retina {
@@ -239,9 +256,6 @@ $sprite-maps: ();
239
256
  @if $repeat-retina != $repeat {
240
257
  background-repeat: $repeat-retina;
241
258
  }
242
- // @if $position-retina != $position {
243
- // background-position-x: $position-retina;
244
- // }
245
259
  }
246
260
  }
247
261
  }
@@ -260,7 +274,9 @@ $sprite-maps: ();
260
274
  $offset-y: 0, // background offset y (optional)
261
275
  $use-retina: true, // wether to use retina on hi-res screens (optional)
262
276
  $offset-x-retina: null, // background offset x on retina (optional)
263
- $offset-y-retina: null // background offset y on retina (optional)
277
+ $offset-y-retina: null, // background offset y on retina (optional)
278
+ $at-breakpoint: false, // media query
279
+ $legacy-support: false // fallback for media query
264
280
  ) {
265
281
 
266
282
  @if $offset-x-retina == null { $offset-x-retina: $offset-x; }
@@ -272,27 +288,63 @@ $sprite-maps: ();
272
288
  $retina-map: return-sprite-map( $name, $retina: true );
273
289
  }
274
290
 
291
+ // Catching media breakpoints from set-breakpoint
292
+ @if type-of( $at-breakpoint ) == "list" {
293
+ @if ( not $legacy-support ) and length( $at-breakpoint ) > 1 {
294
+ // Inheriting legacy support setting from set-breakpoint
295
+ $legacy-support: nth( $at-breakpoint, 2 );
296
+ }
297
+ $at-breakpoint: nth( $at-breakpoint, 1 );
298
+ }
299
+
275
300
  @if $map and $image {
276
301
  $pos: sprite-position($map, $image);
277
302
  $pos-x: return-offset( nth( $pos, 1 ), $offset-x, "$offset-x must be a number, a pixel value or a percentage!" );
278
303
  $pos-y: return-offset( nth( $pos, 2 ), $offset-y, "$offset-y must be a number, a pixel value or a percentage!" );
279
- background-position: $pos-x $pos-y;
304
+
305
+ @if $at-breakpoint {
306
+ @media #{ $at-breakpoint } {
307
+ background-position: $pos-x $pos-y;
308
+ // Settings that would usually be set by extending %sprite-placeholder-#{ $name }
309
+ // @extend is not possible from within a media query
310
+ background-image: sprite-url( $map );
311
+ background-repeat: return-sprite-setting( $name, 6 );
312
+ }
313
+ } @else {
314
+ background-position: $pos-x $pos-y;
315
+ @extend %sprite-placeholder-#{ $name };
316
+ }
317
+
318
+ @if $legacy-support {
319
+ #{ $legacy-selector } & {
320
+ background-position: $pos-x $pos-y;
321
+ @extend %sprite-placeholder-#{ $name };
322
+ }
323
+ }
324
+
280
325
  @if $retina-map {
281
- @include at-retina( $min-device-pixel-ratio ) {
326
+ @include at-retina( $min-device-pixel-ratio, $at-breakpoint ) {
282
327
  /* Retina sprite */
283
328
  $pos: sprite-position($retina-map, $image);
284
329
  $pos-x: return-offset( nth( $pos, 1 )/2, $offset-x-retina, "$offset-x-retina must be a number, a pixel value or a percentage!" );
285
330
  $pos-y: return-offset( nth( $pos, 2 )/2, $offset-y-retina, "$offset-y-retina must be a number, a pixel value or a percentage!" );
286
331
  background-position: $pos-x $pos-y;
332
+ @if $at-breakpoint {
333
+ // Settings that would usually be set by extending %sprite-placeholder-#{ $name }
334
+ // @extend is not possible from within a media query
335
+ background-image: sprite-url( $retina-map );
336
+ background-size: image-width( sprite-path( $retina-map ) )/2 auto;
337
+ @if return-sprite-setting( $name, 7 ) != return-sprite-setting( $name, 6 ) {
338
+ background-repeat: return-sprite-setting( $name, 7 );
339
+ }
340
+ }
341
+ }
342
+ @if ( not $at-breakpoint ) {
343
+ // Set to optional because placeholder only exists if a retina sprite is set
344
+ @extend %sprite-placeholder-#{ $name }-retina !optional;
287
345
  }
288
346
  }
289
347
  }
290
-
291
- @extend %sprite-placeholder-#{ $name };
292
- @if $use-retina {
293
- // Set to optional because placeholder only exists if a retina sprite is set
294
- @extend %sprite-placeholder-#{ $name }-retina !optional;
295
- }
296
348
  }
297
349
 
298
350
 
@@ -1,12 +1,12 @@
1
1
  .classic {
2
- background-image: url('../../img/test-layout.png?19551384282552');
2
+ background-image: url('../../img/test-layout.png?15501385736652');
3
3
  background-repeat: no-repeat;
4
4
  }
5
5
 
6
6
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
7
7
  .classic {
8
8
  /* Retina sprite */
9
- background-image: url('../../img/test-layout@2x.png?19551384282552');
9
+ background-image: url('../../img/test-layout@2x.png?15501385736652');
10
10
  background-size: 718px auto;
11
11
  }
12
12
  }
@@ -3,14 +3,14 @@
3
3
  * Compiled 2x sprite has all images aligned to the right
4
4
  */
5
5
  .vertical {
6
- background-image: url('../../img/test-position.png?19551384282552');
6
+ background-image: url('../../img/test-position.png?15501385736652');
7
7
  background-repeat: no-repeat;
8
8
  }
9
9
 
10
10
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
11
11
  .vertical {
12
12
  /* Retina sprite */
13
- background-image: url('../../img/test-position@2x.png?19551384282552');
13
+ background-image: url('../../img/test-position@2x.png?15501385736652');
14
14
  background-size: 281px auto;
15
15
  }
16
16
  }
@@ -20,14 +20,14 @@
20
20
  * Compiled 2x sprite has all images aligned to the bottom
21
21
  */
22
22
  .horizontal {
23
- background-image: url('../../img/test-position-alt.png?19551384282552');
23
+ background-image: url('../../img/test-position-alt.png?15501385736652');
24
24
  background-repeat: no-repeat;
25
25
  }
26
26
 
27
27
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
28
28
  .horizontal {
29
29
  /* Retina sprite */
30
- background-image: url('../../img/test-position-alt@2x.png?19551384282552');
30
+ background-image: url('../../img/test-position-alt@2x.png?15501385736652');
31
31
  background-size: 421px auto;
32
32
  }
33
33
  }
@@ -1,12 +1,12 @@
1
1
  .meassure-1, .meassure-2, .meassure-3 {
2
- background-image: url('../../img/test-repeat.png?19551384282552');
2
+ background-image: url('../../img/test-repeat.png?15501385736652');
3
3
  background-repeat: repeat-x;
4
4
  }
5
5
 
6
6
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
7
7
  .meassure-1, .meassure-2, .meassure-3 {
8
8
  /* Retina sprite */
9
- background-image: url('../../img/test-repeat@2x.png?19551384282552');
9
+ background-image: url('../../img/test-repeat@2x.png?15501385736652');
10
10
  background-size: 378px auto;
11
11
  background-repeat: no-repeat;
12
12
  }
@@ -2,14 +2,14 @@
2
2
  * Min device pixel ratio changed to 1.7
3
3
  */
4
4
  .classic {
5
- background-image: url('../../img/test-retina.png?19551384282552');
5
+ background-image: url('../../img/test-retina.png?15501385736652');
6
6
  background-repeat: no-repeat;
7
7
  }
8
8
 
9
9
  @media only screen and (-webkit-min-device-pixel-ratio: 1.7), only screen and (min--moz-device-pixel-ratio: 1.7), only screen and (-moz-min-device-pixel-ratio: 1.7), only screen and (-ms-min-device-pixel-ratio: 1.7), only screen and (-o-min-device-pixel-ratio: 1.7 / 1), only screen and (min-device-pixel-ratio: 1.7), only screen and (min-resolution: 163.2dpi), only screen and (min-resolution: 1.7dppx) {
10
10
  .classic {
11
11
  /* Retina sprite */
12
- background-image: url('../../img/test-retina@2x.png?19551384282552');
12
+ background-image: url('../../img/test-retina@2x.png?15501385736652');
13
13
  background-size: 152px auto;
14
14
  }
15
15
  }
@@ -0,0 +1,69 @@
1
+ .classic, .no-media-queries .indy {
2
+ background-image: url('../../img/test-retina.png?15511385736703');
3
+ background-repeat: no-repeat;
4
+ }
5
+
6
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
7
+ .classic {
8
+ /* Retina sprite */
9
+ background-image: url('../../img/test-retina@2x.png?15511385736703');
10
+ background-size: 152px auto;
11
+ }
12
+ }
13
+
14
+ .classic {
15
+ background-position: 0 -281px;
16
+ width: 152px;
17
+ height: 135px;
18
+ }
19
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
20
+ .classic {
21
+ /* Retina sprite */
22
+ background-position: 0 -140px;
23
+ }
24
+ }
25
+
26
+ .indy {
27
+ width: 128px;
28
+ height: 140px;
29
+ }
30
+ @media (min-width: 400px) {
31
+ .indy {
32
+ background-position: 0 -141px;
33
+ background-image: url('../../img/test-retina.png?15511385736703');
34
+ background-repeat: no-repeat;
35
+ }
36
+ }
37
+ @media only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 400px), only screen and (min--moz-device-pixel-ratio: 2) and (min-width: 400px), only screen and (-moz-min-device-pixel-ratio: 2) and (min-width: 400px), only screen and (-ms-min-device-pixel-ratio: 2) and (min-width: 400px), only screen and (-o-min-device-pixel-ratio: 2 / 1) and (min-width: 400px), only screen and (min-device-pixel-ratio: 2) and (min-width: 400px), only screen and (min-resolution: 192dpi) and (min-width: 400px), only screen and (min-resolution: 2dppx) and (min-width: 400px) {
38
+ .indy {
39
+ /* Retina sprite */
40
+ background-position: 0 0;
41
+ background-image: url('../../img/test-retina@2x.png?15511385736703');
42
+ background-size: 152px auto;
43
+ }
44
+ }
45
+ @media (min-width: 960px) {
46
+ .indy {
47
+ background-position: 0 -281px;
48
+ background-image: url('../../img/test-retina.png?15511385736703');
49
+ background-repeat: no-repeat;
50
+ }
51
+ }
52
+ @media only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 960px), only screen and (min--moz-device-pixel-ratio: 2) and (min-width: 960px), only screen and (-moz-min-device-pixel-ratio: 2) and (min-width: 960px), only screen and (-ms-min-device-pixel-ratio: 2) and (min-width: 960px), only screen and (-o-min-device-pixel-ratio: 2 / 1) and (min-width: 960px), only screen and (min-device-pixel-ratio: 2) and (min-width: 960px), only screen and (min-resolution: 192dpi) and (min-width: 960px), only screen and (min-resolution: 2dppx) and (min-width: 960px) {
53
+ .indy {
54
+ /* Retina sprite */
55
+ background-position: 0 -140px;
56
+ background-image: url('../../img/test-retina@2x.png?15511385736703');
57
+ background-size: 152px auto;
58
+ }
59
+ }
60
+ @media (min-width: 1024px) {
61
+ .indy {
62
+ background-position: 0 0;
63
+ background-image: url('../../img/test-retina.png?15511385736703');
64
+ background-repeat: no-repeat;
65
+ }
66
+ }
67
+ .no-media-queries .indy {
68
+ background-position: 0 0;
69
+ }
@@ -1,12 +1,12 @@
1
1
  .classic, .indy, .alien {
2
- background-image: url('../../img/test-retina.png?19551384282552');
2
+ background-image: url('../../img/test-retina.png?15501385736653');
3
3
  background-repeat: no-repeat;
4
4
  }
5
5
 
6
6
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
7
7
  .classic, .indy {
8
8
  /* Retina sprite */
9
- background-image: url('../../img/test-retina@2x.png?19551384282552');
9
+ background-image: url('../../img/test-retina@2x.png?15501385736653');
10
10
  background-size: 152px auto;
11
11
  }
12
12
  }
@@ -1,5 +1,5 @@
1
1
  .classic, .indy {
2
- background-image: url('../../img/test-simple.png?19551384282552');
2
+ background-image: url('../../img/test-simple.png?15501385736653');
3
3
  background-repeat: no-repeat;
4
4
  }
5
5
 
@@ -1,12 +1,12 @@
1
1
  .classic {
2
- background-image: url('../../img/test-spacing.png?19551384282552');
2
+ background-image: url('../../img/test-spacing.png?15501385736653');
3
3
  background-repeat: no-repeat;
4
4
  }
5
5
 
6
6
  @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-ms-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
7
7
  .classic {
8
8
  /* Retina sprite */
9
- background-image: url('../../img/test-spacing@2x.png?19551384282552');
9
+ background-image: url('../../img/test-spacing@2x.png?15501385736653');
10
10
  background-size: 159px auto;
11
11
  }
12
12
  }
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+
6
+ <title>Sprite: responsive</title>
7
+
8
+ <meta name="description" content="Ezy Grid Demo">
9
+ <meta name="viewport" content="width=device-width">
10
+
11
+ <link href="../../css/sprites/responsive.css" rel="stylesheet">
12
+
13
+ </head>
14
+ <body>
15
+ <div class="classic">&nbsp;</div>
16
+ <div class="indy">&nbsp;</div>
17
+ <div class="alien">&nbsp;</div>
18
+ </body>
19
+ </html>
@@ -0,0 +1,52 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "../../../sass/ezy/media";
5
+ @import "../../../sass/ezy/sprites";
6
+
7
+ // ---------------------------------------------------------------------------
8
+ // Defining media query breakpoints
9
+
10
+ $breakpoint-small: set-breakpoint( $max: 580px );
11
+ $breakpoint-medium: set-breakpoint( $min: 960px );
12
+ $breakpoint-large: set-breakpoint( $min: 1024px, $legacy-support: true ); // Support for legacy browsers
13
+
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // Create sprite
17
+
18
+ @include make-sprite(
19
+ $name: "base",
20
+ $folder: "test-retina",
21
+ $folder-retina: "test-retina@2x"
22
+ );
23
+
24
+ // ---------------------------------------------------------------------------
25
+ // Use sprite
26
+
27
+ .classic {
28
+ @include background-sprite( "base", "classic" );
29
+ width: 152px;
30
+ height: 135px;
31
+ }
32
+
33
+ .indy {
34
+ @include background-sprite(
35
+ $name: "base",
36
+ $image: "indy",
37
+ $at-breakpoint: "(min-width: 400px)"
38
+ );
39
+ @include background-sprite(
40
+ $name: "base",
41
+ $image: "classic",
42
+ $at-breakpoint: $breakpoint-medium
43
+ );
44
+ @include background-sprite(
45
+ $name: "base",
46
+ $image: "alien",
47
+ $use-retina: false,
48
+ $at-breakpoint: $breakpoint-large
49
+ );
50
+ width: 128px;
51
+ height: 140px;
52
+ }
metadata CHANGED
@@ -1,73 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ezy
3
- version: !ruby/object:Gem::Version
4
- hash: -933531639
5
- prerelease: 6
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- - alpha
11
- version: 0.2.0.alpha
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
12
5
  platform: ruby
13
- authors:
6
+ authors:
14
7
  - Frej Raahede Nielsen
15
8
  autorequire:
16
9
  bindir: bin
17
10
  cert_chain: []
18
-
19
- date: 2013-11-13 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2013-12-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: compass
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 43
30
- segments:
31
- - 0
32
- - 12
33
- - 2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
34
19
  version: 0.12.2
35
20
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: sass
39
21
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 15
46
- segments:
47
- - 3
48
- - 2
49
- - 0
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.12.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: sass
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
50
33
  version: 3.2.0
51
34
  type: :runtime
52
- version_requirements: *id002
53
- description: A collection of SCSS tools for creating responsive websites. Includes a simple but powerful grid framework, media query helpers and sprite helpers.
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.0
41
+ description: A collection of SCSS tools for creating responsive websites. Includes
42
+ a simple but powerful grid framework, media query helpers and sprite helpers.
54
43
  email: frejraahede@gmail.com
55
44
  executables: []
56
-
57
45
  extensions: []
58
-
59
46
  extra_rdoc_files: []
60
-
61
- files:
47
+ files:
62
48
  - README.md
63
49
  - ezy.gemspec
64
50
  - VERSION
65
51
  - lib/ezy.rb
66
52
  - sass/_ezy.scss
67
- - sass/ezy/_clearfix.scss
68
- - sass/ezy/_functions.scss
69
- - sass/ezy/_grid.scss
70
- - sass/ezy/_media.scss
71
53
  - sass/ezy/_sprites.scss
72
54
  - templates/project/_settings.scss
73
55
  - templates/project/index.html
@@ -84,6 +66,7 @@ files:
84
66
  - test/css/sprites/position.css
85
67
  - test/css/sprites/repeat.css
86
68
  - test/css/sprites/resolution.css
69
+ - test/css/sprites/responsive.css
87
70
  - test/css/sprites/retina.css
88
71
  - test/css/sprites/simple.css
89
72
  - test/css/sprites/size.css
@@ -98,11 +81,13 @@ files:
98
81
  - test/scss/sprites/position.scss
99
82
  - test/scss/sprites/repeat.scss
100
83
  - test/scss/sprites/resolution.scss
84
+ - test/scss/sprites/responsive.scss
101
85
  - test/scss/sprites/retina.scss
102
86
  - test/scss/sprites/simple.scss
103
87
  - test/scss/sprites/size.scss
104
88
  - test/scss/sprites/spacing.scss
105
89
  - test/html/sprites/repeat.html
90
+ - test/html/sprites/responsive.html
106
91
  - test/html/sprites/retina.html
107
92
  - test/html/sprites/simple.html
108
93
  - test/img/test-layout/alien.png
@@ -144,39 +129,27 @@ files:
144
129
  - test/img/test-spacing@2x/classic.png
145
130
  - test/img/test-spacing@2x/indy.png
146
131
  homepage: http://github.com/raahede/
147
- licenses:
132
+ licenses:
148
133
  - MIT
134
+ metadata: {}
149
135
  post_install_message:
150
136
  rdoc_options: []
151
-
152
- require_paths:
137
+ require_paths:
153
138
  - lib
154
- required_ruby_version: !ruby/object:Gem::Requirement
155
- none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- hash: 3
160
- segments:
161
- - 0
162
- version: "0"
163
- required_rubygems_version: !ruby/object:Gem::Requirement
164
- none: false
165
- requirements:
166
- - - ">"
167
- - !ruby/object:Gem::Version
168
- hash: 25
169
- segments:
170
- - 1
171
- - 3
172
- - 1
173
- version: 1.3.1
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - '>='
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
174
149
  requirements: []
175
-
176
150
  rubyforge_project:
177
- rubygems_version: 1.8.25
151
+ rubygems_version: 2.1.11
178
152
  signing_key:
179
- specification_version: 3
153
+ specification_version: 4
180
154
  summary: The developer's toolbox for responsive websites
181
155
  test_files: []
182
-
@@ -1,25 +0,0 @@
1
- /* -------------------------------------------------------------------- *
2
- * Micro Clearfix
3
- * http://nicolasgallagher.com/micro-clearfix-hack/
4
- */
5
-
6
- %clearfix:before,
7
- %clearfix:after {
8
- content: " ";
9
- display: table;
10
- }
11
-
12
- %clearfix:after {
13
- clear: both;
14
- }
15
-
16
-
17
- %clearfix {
18
- /**
19
- * For IE 6/7 only
20
- * Include this rule to trigger hasLayout and contain floats.
21
- */
22
- *zoom: 1;
23
- }
24
-
25
- /* -------------------------------------------------------------------- */
@@ -1,11 +0,0 @@
1
-
2
- // ---------------------------------------------------------------------------
3
- // @function percentage-round
4
- //
5
- // Similar to the SASS percentage() function, but rounds down to 2 decimals
6
- // $columns : Fraction to convert to percentage
7
- // @return : Percentage value rounded down to 2 decimals
8
-
9
- @function percentage-round( $value ) {
10
- @return floor( percentage( $value ) * 100 ) / 100;
11
- }
data/sass/ezy/_grid.scss DELETED
@@ -1,279 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- // Importing dependencies
3
-
4
- @import "functions";
5
- @import "clearfix";
6
-
7
- // ---------------------------------------------------------------------------
8
- // Mandatory grid settings
9
- // Defaults: can be overridden
10
-
11
- $column-width: 4em !default;
12
- $gutter-width: 1em !default;
13
- $default-gutter-property: "margin" !default;
14
- $total-columns: 12 !default;
15
- $is-fluid: true !default;
16
-
17
- // ---------------------------------------------------------------------------
18
- // Variables used in grid context
19
-
20
- $grid-init: false;
21
- $context-warn: "You must set $context if $is-fluid is set to true.";
22
- $init-gutter-property: $default-gutter-property;
23
-
24
- // ---------------------------------------------------------------------------
25
- // @function layout-width
26
- //
27
- // Returns width based on given number of culumns
28
- // $columns : Number of columns to calculate width from
29
- // @return : Width in the same unit as $column-width and $gutter-width
30
-
31
- @function layout-width( $columns ) {
32
- @if comparable( $column-width, $gutter-width ) {
33
- @return $columns * ( $column-width + $gutter-width ) - $gutter-width;
34
- } @else {
35
- @warn "$column-width and $gutter-width must have the same unit set. #{ unit($column-width) }'s and #{ unit($gutter-width) }'s are not comparable.";
36
- }
37
- }
38
-
39
- // ---------------------------------------------------------------------------
40
- // @function context-width
41
- //
42
- // Returns width based on given number of culumns, plus an extra gutter
43
- // Used for % calculations in the grid
44
- // $columns : Number of columns to calculate width from
45
- // @return : Width in the same unit as $column-width and $gutter-width
46
-
47
- @function context-width( $columns ) {
48
- @return layout-width( $columns ) + $gutter-width;
49
- }
50
-
51
- // ---------------------------------------------------------------------------
52
- // @function span-column-width
53
- //
54
- // Same as layout-width( $columns ), but renamed for better context awareness
55
-
56
- @function span-column-width( $columns ) {
57
- @return layout-width( $columns );
58
- }
59
-
60
- // ---------------------------------------------------------------------------
61
- // @function gutter
62
- //
63
- // Returns gutter in the same unit as $gutter-width if grid is static
64
- // Returns gutter as a percentage of the context if grid is fluid
65
- // $context : Number of columns in the current context.
66
- // : If set to false, the returned value is as in static grid
67
- // @return : Width as $gutter-width or as a percentage of the context
68
-
69
- @function gutter(
70
- $context: false
71
- ) {
72
- @if $is-fluid and $context {
73
- @return ( percentage-round( ( $gutter-width / 2 ) / context-width( $context ) ) );
74
- } @else if $is-fluid {
75
- @warn $context-warn;
76
- } @else {
77
- @return $gutter-width / 2;
78
- }
79
- }
80
-
81
- // ---------------------------------------------------------------------------
82
- // @mixin gutters
83
- //
84
- // Sets gutters using the gutter( $context ) function
85
- // $context : Number of columns in the current context.
86
- // : Only mandatory if grid is fluid
87
- // $gutter-property : Set to "margin" or "padding"
88
-
89
- @mixin gutters(
90
- $context: false,
91
- $property: false
92
- ) {
93
- @if (not $property) {
94
- $property: $default-gutter-property;
95
- }
96
- @if $property == "margin" or $property == "padding" {
97
- float: left;
98
- #{ $property }: {
99
- left: gutter( $context );
100
- right: gutter( $context );
101
- }
102
- } @else {
103
- @warn "$gutter-property must be set to either 'margin' or 'padding'";
104
- }
105
- }
106
-
107
- // ---------------------------------------------------------------------------
108
- // Grid master placeholder selector
109
- // Adds cleafix and centers page in browser
110
-
111
- %ezy-master {
112
- @extend %clearfix;
113
- margin: {
114
- left: auto;
115
- right: auto;
116
- }
117
- }
118
-
119
- // ---------------------------------------------------------------------------
120
- // @mixin master
121
- //
122
- // Sets width on page. If the grid is fluid, it's set as a max-width
123
- // Extends the grid master placeholder selector
124
- // $context : Number of columns in the current context.
125
-
126
- @mixin master(
127
- $context
128
- ) {
129
- @if $is-fluid {
130
- max-width: layout-width( $context );
131
- } @else {
132
- width: layout-width( $context );
133
- }
134
- @extend %ezy-master;
135
- }
136
-
137
- // ---------------------------------------------------------------------------
138
- // Grid container placeholder selector
139
- // Adds cleafix
140
-
141
- %ezy-container {
142
- @extend %clearfix;
143
- }
144
-
145
- // ---------------------------------------------------------------------------
146
- // @mixin container
147
- //
148
- // Sets width on page. If the grid is fluid, it's set as a max-width
149
- // Extends the grid master placeholder selector
150
- // $context : Number of columns in the current context
151
- // : Only mandatory if grid is fluid
152
- // $at-breakpoint : Set to true if mixin is called within a media query
153
- // : Avoids SASS compillation errors from extending within
154
- // : a media query
155
-
156
- @mixin container(
157
- $context: false,
158
- $at-breakpoint: false
159
- ) {
160
- $pullout: -( $gutter-width )/2;
161
- @if $is-fluid and $context {
162
- $pullout: -( percentage-round( $gutter-width / layout-width( $context ) ) )/2;
163
- } @else if $is-fluid {
164
- @warn $context-warn;
165
- }
166
- margin: {
167
- left: $pullout;
168
- right: $pullout;
169
- }
170
- @if (not $at-breakpoint) {
171
- @extend %ezy-container;
172
- }
173
- }
174
-
175
- // ---------------------------------------------------------------------------
176
- // @mixin grid-init
177
- //
178
- // Prints out placeholder selectors used with columns. Helps reduce the CSS output.
179
- //
180
- // Should be called after setting grid variables:
181
- // ----------------
182
- // $column-width
183
- // $gutter-width
184
- // $gutter-property
185
- // $total-columns
186
- // ----------------
187
-
188
- @mixin grid-init() {
189
- $grid-init: true;
190
- $init-gutter-property: $default-gutter-property;
191
- @if $is-fluid {
192
- @for $i from 1 through $total-columns {
193
- %ezy-column-#{ $i } {
194
- @include gutters( $i );
195
- }
196
- }
197
- } @else {
198
- %ezy-column {
199
- @include gutters;
200
- }
201
- }
202
- }
203
-
204
- // ---------------------------------------------------------------------------
205
- // @mixin span-columns
206
- //
207
- // Sets width and gutter on columns
208
- // Uses @extend for gutters outside media queries if grid-init() has been called
209
- // $columns : Number of columns to span
210
- // $context : Number of columns in the current context
211
- // : Only mandatory if grid is fluid
212
- // $at-breakpoint : Set to true if mixin is called within a media query
213
- // : Avoids SASS compillation errors from extending within
214
- // : a media query
215
- // $gutter-property : Overrides the global $gutter-property
216
-
217
- @mixin span-columns(
218
- $columns,
219
- $context: false,
220
- $at-breakpoint: false,
221
- $gutter-property: false
222
- ) {
223
- $width: span-column-width( $columns );
224
- @if $is-fluid and $context {
225
- /* Spanning #{ $columns } of #{ $context } columns */
226
- $context-width: context-width( $context );
227
- $pct-width: percentage-round( $width / $context-width );
228
- width: $pct-width;
229
- } @else {
230
- /* Spanning #{ $columns } columns */
231
- width: $width;
232
- }
233
-
234
- @if $gutter-property and $gutter-property != $default-gutter-property {
235
-
236
- @if $is-fluid and $context {
237
- @include gutters( $context, $gutter-property );
238
-
239
- } @else if ( not $is-fluid ) {
240
- @include gutters( $property: $gutter-property );
241
-
242
- } @else if $is-fluid and ( not $context ) {
243
- @warn $context-warn;
244
- }
245
-
246
- } @else if $is-fluid and $context {
247
-
248
- @if $at-breakpoint or $init-gutter-property != $default-gutter-property {
249
- @include gutters( $context );
250
-
251
- } @else if ( $total-columns < $context ) {
252
- @include gutters( $context );
253
- @warn "Please check if $total-columns is set. $total-columns should be the highest number of columns occuring in your layout. This error will not break your layout, but will increase the CSS output.";
254
-
255
- } @else if ( not $grid-init ) {
256
- @include gutters( $context );
257
- @warn "Include grid-init() after setting $total-columns for cleaner CSS output.";
258
-
259
- } @else {
260
- @extend %ezy-column-#{ $context };
261
- }
262
-
263
-
264
- } @else if $is-fluid { // $context not set
265
-
266
- @warn $context-warn;
267
-
268
- } @else if $grid-init and $init-gutter-property == $default-gutter-property { // Grid is static
269
- @extend %ezy-column;
270
-
271
- } @else {
272
- @include gutters( $context );
273
-
274
- @if (not $grid-init) {
275
- @warn "Include grid-init() after setting $gutter-width for cleaner CSS output.";
276
- }
277
- }
278
- }
279
-
data/sass/ezy/_media.scss DELETED
@@ -1,48 +0,0 @@
1
-
2
- $legacy-selector: ".no-media-queries" !default;
3
-
4
- @function set-breakpoint(
5
- $min: false,
6
- $max: false,
7
- $custom: false,
8
- $legacy-support: false
9
- ) {
10
-
11
- @if (not $min) and (not $max) and (not $custom) {
12
- @warn "Either $min, $max, or $custom must be defined for set-breakpoint to work.";
13
- }
14
-
15
- @if $min and $max {
16
- // Both $min and $max
17
- @return "(min-width: #{ $min }) and (max-width: #{ $max })", $legacy-support;
18
- } @else {
19
- @if $min and (not $max) {
20
- // Min only:
21
- @return "(min-width: #{ $min })", $legacy-support;
22
- }
23
- @if $max and (not $min) {
24
- // Max only:
25
- @return "(max-width: #{ $max })", $legacy-support;
26
- } @else {
27
- // Custom:
28
- @return $custom, $legacy-support;
29
- }
30
- }
31
- }
32
-
33
- @mixin at-breakpoint(
34
- $breakpoint,
35
- $legacy-support: false
36
- ) {
37
- @media #{ nth( $breakpoint, 1 ) } {
38
- @content;
39
- }
40
- @if $legacy-support or nth( $breakpoint, 2 ) {
41
- #{ $legacy-selector } & {
42
- /* Fallback for browsers not supporting media queries */
43
- @content;
44
- }
45
- }
46
- }
47
-
48
-