ezy 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +95 -11
- data/ezy.gemspec +3 -3
- data/sass/ezy/_sprites.scss +36 -39
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e4a4d640319b0dd69de17325d9fbe8c5eb20019
|
4
|
+
data.tar.gz: ac43b0b47043148d7d7fe98a30294ef9f20b1aa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db2f98065fe821b90d9dbdef892a3f296e421fa22543b6847a4ebf1bd4dfeef60fc6c61524b1f04368939b43f75bb895120302e8feb1c8df42463a1227612632
|
7
|
+
data.tar.gz: 1a04b58d62f47d62a21e4c971d97834cbe8cd98afaeac21cb938b4493c418a9d043ed3cdf7aff77fff5dede1400d8820b45b983ace470e6e1c326f6e63004207
|
data/README.md
CHANGED
@@ -1,17 +1,101 @@
|
|
1
|
-
Ezy
|
2
|
-
|
1
|
+
Ezy: The developer's toolbox for responsive websites
|
2
|
+
====================================================
|
3
3
|
|
4
|
-
My attempt to create a collection of simple-to-use grid helpers with SCSS
|
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
8
|
|
7
|
-
|
8
|
-
------------------------
|
9
|
+
#### 1) Install the gem
|
9
10
|
|
10
|
-
|
11
|
-
$ gem build ezy.gemspec
|
11
|
+
`gem install ezy`
|
12
12
|
|
13
|
-
|
14
|
-
$ gem install --local ezy-[build version].gem
|
13
|
+
#### 2) Require Ezy in your config.rb
|
15
14
|
|
16
|
-
|
17
|
-
|
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 grid only:
|
24
|
+
|
25
|
+
`@import "ezy/grid";`
|
26
|
+
|
27
|
+
Import sprites only:
|
28
|
+
|
29
|
+
`@import "ezy/sprites";`
|
30
|
+
|
31
|
+
Using Ezy
|
32
|
+
---------
|
33
|
+
|
34
|
+
### Sprites
|
35
|
+
|
36
|
+
#### 1) Create sprite
|
37
|
+
|
38
|
+
Simple use without retina:
|
39
|
+
|
40
|
+
@include make-sprite(
|
41
|
+
$name: "icons", // (required) your name to use when calling sprites
|
42
|
+
$folder: "icon-images" // (required) folder path relative to image folder
|
43
|
+
);
|
44
|
+
|
45
|
+
Simple use with retina:
|
46
|
+
|
47
|
+
@include make-sprite(
|
48
|
+
$name: "icons", // (required) your name to use when calling sprites
|
49
|
+
$folder: "icon-images", // (required) folder path relative to image folder
|
50
|
+
$folder-retina: "icon-images@2x" // (optional) folder path relative to image folder
|
51
|
+
);
|
52
|
+
|
53
|
+
Advanced use:
|
54
|
+
|
55
|
+
@include make-sprite(
|
56
|
+
$name: "icons", // (required) your name to use when calling sprites
|
57
|
+
$folder: "icon-images", // (required) folder path relative to image folder
|
58
|
+
$folder-retina: "icon-images@2x", // (optional) folder path relative to image folder
|
59
|
+
$spacing: 20px, // (optional) defaults to 0px
|
60
|
+
$layout: vertical, // (optional) vertical, horizontal, diagonal
|
61
|
+
$spacing-retina: null, // (optional) defaults to $spacing x 2
|
62
|
+
$layout-retina: null // (optional) defaults to $layout
|
63
|
+
);
|
64
|
+
|
65
|
+
#### 2) Use sprite
|
66
|
+
|
67
|
+
Simple use without retina:
|
68
|
+
|
69
|
+
.icon-git-fork {
|
70
|
+
@include background-sprite( "icons", "git-fork" ); // using image git-fork.png from images/icon-images/
|
71
|
+
}
|
72
|
+
|
73
|
+
Simple use with retina:
|
74
|
+
|
75
|
+
.icon-git-fork {
|
76
|
+
@include background-sprite( "icons", "git-fork", $use-retina: true );
|
77
|
+
}
|
78
|
+
|
79
|
+
Advanced use:
|
80
|
+
|
81
|
+
.icon-git-fork {
|
82
|
+
@include background-sprite(
|
83
|
+
$name: "icons", // (required) sprite name
|
84
|
+
$image: "git-fork", // (required) image to use
|
85
|
+
$use-retina: true, // (optional) wether to use retina on hi-res screens
|
86
|
+
$offset-x: 10px, // (optional) background offset x
|
87
|
+
$offset-y: 20px // (optional) background offset y
|
88
|
+
);
|
89
|
+
}
|
90
|
+
|
91
|
+
Building and testing local gem
|
92
|
+
------------------------------
|
93
|
+
|
94
|
+
#### Build gem ###
|
95
|
+
`gem build ezy.gemspec`
|
96
|
+
|
97
|
+
#### Install local gem ###
|
98
|
+
`gem install --local ezy-[build version].gem`
|
99
|
+
|
100
|
+
#### Open installed gem location (Mac) ###
|
101
|
+
`open /Users/[username]/.rvm/gems/`
|
data/ezy.gemspec
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
# Release Specific Information
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.6"
|
6
6
|
s.date = "2013-11-12"
|
7
7
|
|
8
8
|
# Gem Details
|
9
9
|
s.name = "ezy"
|
10
10
|
s.author = "Frej Raahede Nielsen"
|
11
|
-
s.summary = "
|
12
|
-
s.description = "
|
11
|
+
s.summary = "The developer's toolbox for responsive websites"
|
12
|
+
s.description = "A collection of SCSS tools for creating responsive websites. Includes a simple but powerful grid framework, media query helpers and sprite helpers."
|
13
13
|
s.email = "frejraahede@gmail.com"
|
14
14
|
s.homepage = "http://github.com/raahede/"
|
15
15
|
s.license = "MIT"
|
data/sass/ezy/_sprites.scss
CHANGED
@@ -48,9 +48,9 @@ $sprite-maps: ();
|
|
48
48
|
$sprite: false;
|
49
49
|
@if $retina {
|
50
50
|
$map: return-sprite-setting( $name, 3 );
|
51
|
-
@if (not $map) {
|
52
|
-
|
53
|
-
}
|
51
|
+
// @if (not $map) {
|
52
|
+
// @warn "The sprite '#{$name}' doesn't appear to have a retina version. Please check your sprite settings.";
|
53
|
+
// }
|
54
54
|
} @else {
|
55
55
|
$map: return-sprite-setting( $name, 2 );
|
56
56
|
}
|
@@ -83,6 +83,22 @@ $sprite-maps: ();
|
|
83
83
|
}
|
84
84
|
}
|
85
85
|
|
86
|
+
// ---------------------------------------------------------------------------
|
87
|
+
// @function return-sprite-repeat
|
88
|
+
//
|
89
|
+
// Helper function to return a sprite's css repeat
|
90
|
+
|
91
|
+
@function return-offset( $reference, $adjustment, $fail-msg ) {
|
92
|
+
@if unit($adjustment) == "%" {
|
93
|
+
@return $adjustment;
|
94
|
+
} @else if unit($adjustment) == "px" or unit($adjustment) == "" {
|
95
|
+
@return ( $reference + $adjustment );
|
96
|
+
} @else {
|
97
|
+
@warn $fail-msg;
|
98
|
+
@return $reference;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
86
102
|
// ---------------------------------------------------------------------------
|
87
103
|
// @function sprite-image-width
|
88
104
|
//
|
@@ -227,58 +243,39 @@ $sprite-maps: ();
|
|
227
243
|
}
|
228
244
|
|
229
245
|
// ---------------------------------------------------------------------------
|
230
|
-
// @mixin sprite
|
246
|
+
// @mixin background-sprite
|
231
247
|
//
|
232
|
-
//
|
248
|
+
// Mixin for using sprites stored in the sprite map variable
|
233
249
|
|
234
|
-
@mixin sprite
|
235
|
-
$
|
250
|
+
@mixin background-sprite(
|
251
|
+
$name, // sprite name
|
236
252
|
$image, // image to use
|
237
|
-
$retina-map: false, // retina sprite map (optional)
|
238
253
|
$offset-x: 0, // background offset x (optional)
|
239
|
-
$offset-y: 0
|
240
|
-
)
|
254
|
+
$offset-y: 0, // background offset y (optional)
|
255
|
+
$use-retina: true // wether to use retina on hi-res screens (optional)
|
256
|
+
) {
|
257
|
+
$map: return-sprite-map( $name );
|
258
|
+
$retina-map: $use-retina;
|
259
|
+
@if $use-retina {
|
260
|
+
$retina-map: return-sprite-map( $name, $retina: true );
|
261
|
+
}
|
262
|
+
|
241
263
|
@if $map and $image {
|
242
264
|
$pos: sprite-position($map, $image);
|
243
|
-
$pos-x: nth( $pos, 1 )
|
244
|
-
$pos-y: nth( $pos, 2 )
|
265
|
+
$pos-x: return-offset( nth( $pos, 1 ), $offset-x, "$offset-x must be a number, a pixel value or a percentage!" );
|
266
|
+
$pos-y: return-offset( nth( $pos, 2 ), $offset-y, "$offset-y must be a number, a pixel value or a percentage!" );
|
245
267
|
background-position: $pos-x $pos-y;
|
246
268
|
@if $retina-map {
|
247
269
|
@include at-retina {
|
248
270
|
/* Retina sprite */
|
249
271
|
$pos: sprite-position($retina-map, $image);
|
250
|
-
$pos-x: nth( $pos, 1 )/2
|
251
|
-
$pos-y: nth( $pos, 2 )/2
|
272
|
+
$pos-x: return-offset( nth( $pos, 1 )/2, $offset-x, "$offset-x must be a number, a pixel value or a percentage!" );
|
273
|
+
$pos-y: return-offset( nth( $pos, 2 )/2, $offset-y, "$offset-y must be a number, a pixel value or a percentage!" );
|
252
274
|
background-position: $pos-x $pos-y;
|
253
275
|
}
|
254
276
|
}
|
255
277
|
}
|
256
|
-
}
|
257
278
|
|
258
|
-
// ---------------------------------------------------------------------------
|
259
|
-
// @mixin background-sprite
|
260
|
-
//
|
261
|
-
// Mixin for using sprites stored in the sprite map variable
|
262
|
-
|
263
|
-
@mixin background-sprite(
|
264
|
-
$name, // sprite name
|
265
|
-
$image, // image to use
|
266
|
-
$use-retina: true, // wether to use retina on hi-res screens (optional)
|
267
|
-
$offset-x: 0, // background offset x (optional)
|
268
|
-
$offset-y: 0 // background offset y (optional)
|
269
|
-
) {
|
270
|
-
$map: return-sprite-map( $name );
|
271
|
-
$retina-map: $use-retina;
|
272
|
-
@if $use-retina {
|
273
|
-
$retina-map: return-sprite-map( $name, $retina: true );
|
274
|
-
}
|
275
|
-
@include sprite-base(
|
276
|
-
$map: $map, // sprite map
|
277
|
-
$image: $image, // image to use
|
278
|
-
$retina-map: $retina-map, // retina sprite map (optional)
|
279
|
-
$offset-x: $offset-x, // background offset x (optional)
|
280
|
-
$offset-y: $offset-y // background offset y (optional)
|
281
|
-
);
|
282
279
|
@extend %sprite-placeholder-#{ $name };
|
283
280
|
@if $use-retina {
|
284
281
|
// Set to optional because placeholder only exists if a retina sprite is set
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frej Raahede Nielsen
|
@@ -38,8 +38,8 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.2.0
|
41
|
-
description:
|
42
|
-
|
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.
|
43
43
|
email: frejraahede@gmail.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
@@ -155,5 +155,5 @@ rubyforge_project:
|
|
155
155
|
rubygems_version: 2.1.10
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
|
-
summary:
|
158
|
+
summary: The developer's toolbox for responsive websites
|
159
159
|
test_files: []
|