stipe 0.0.5.2 → 0.0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,3 +8,4 @@
8
8
  @import "gradients";
9
9
  @import "forms";
10
10
  @import "buttons";
11
+ @import "plug-ins";
@@ -11,4 +11,9 @@ $tablet: "screen and (max-width: 64em)" !default;
11
11
  $tablet_portrait: "screen and (max-width: 64em) and (orientation: portrait)" !default;
12
12
  $tablet_landscape: "screen and (max-width: 64em) and (orientation: landscape)" !default;
13
13
 
14
- $desktop: "screen and (max-width: 120em) and (min-width: 50em)" !default;
14
+ $desktop: "screen and (max-width: 120em) and (min-width: 50em)" !default;
15
+
16
+ $hidpi: "(-webkit-min-device-pixel-ratio: 1.3),
17
+ (-o-min-device-pixel-ratio: 2.6/2),
18
+ (min--moz-device-pixel-ratio: 1.3),
19
+ (min-device-pixel-ratio: 1.3),(min-resolution: 1.3dppx)" !default;
@@ -0,0 +1,3 @@
1
+ // General manifest of plug-in awesome from other projects
2
+
3
+ @import "plug-ins/hidpi";
@@ -0,0 +1,32 @@
1
+ // Inspired by Tim Kadlec | Media Query & Asset Downloading Results
2
+ // http://timkadlec.com/2012/04/media-query-asset-downloading-results/
3
+
4
+ // Inspired by kaelig / hidpi
5
+ // https://github.com/kaelig/hidpi
6
+ // hidpi() is a Sass mixin that serves high resolution graphics to high density (Retina-like) displays
7
+
8
+ $extension: png !default;
9
+
10
+ @mixin hidpi($image: false, $extension: $extension) {
11
+ @if $image {
12
+ background: url('#{$imgDir}#{$image}.#{$extension}') no-repeat;
13
+ }
14
+ @media #{$hidpi} {
15
+ @if $image {
16
+ $image-hidpi-fullname: '#{$imgDir}#{$image}_x2.#{$extension}';
17
+ background: url($image-hidpi-fullname) no-repeat;
18
+ @content;
19
+ }
20
+ @else {
21
+ @content;
22
+ }
23
+ }
24
+ }
25
+
26
+ @mixin hidpi-image ($image: false, $width: false, $height: false, $extension: $extension) {
27
+ width: em($width);
28
+ height: em($height);
29
+ @include hidpi ($image, $extension) {
30
+ background-size: em($width) em($height);
31
+ }
32
+ }
@@ -0,0 +1,45 @@
1
+ #Stipe Plug-Ins
2
+ The following is a growing list of awesome work from others that I felt would be awesome to include in the Toadstool framework.
3
+
4
+ ##Retinafy your website with Sass & Compass
5
+ Inspired by Kaelig's [`hidpi()` mixin](https://github.com/kaelig/hidpi) and [Tim Kadlec's work](http://timkadlec.com/2012/04/media-query-asset-downloading-results/) on optimizing the delivering of images, Stipe supports a simple mixing to 'retinafy' your site.
6
+
7
+ ##How to use
8
+ Using Stipe's hidpi support you can either retinafy common elements in the UI or serve up different images.
9
+
10
+ ###hidpi common elements
11
+ Example: alter a visual element based on the resolution of the device, you could do the following:
12
+
13
+ ```scss
14
+ #logo {
15
+ border: 1px solid green;
16
+ width: 100%;
17
+ height: 200px;
18
+ float: left;
19
+ @include hidpi {
20
+ border: 1px solid orange;
21
+ }
22
+ }
23
+ ```
24
+
25
+ In this example, all standard def devices will get the base green border. But anything that falls within the hidpi device spectrum will get the orange border.
26
+
27
+ ###hidpi images
28
+ The more common case is that you need to address two different resolution images. The process is simple. Use the `hidpi-image` mixing and pass in a few simple arguments. `$image`, `$width` and `$height`. By default the file extension is set to `png`, but you can change that with the final argument `$extension`.
29
+
30
+ The trick to the hipdi solution is that you need to place a corresponding image in the same directory with `_x2` in the name. Example `logo_x2.png` would work.
31
+
32
+ Simply write your CSS rule like the following:
33
+
34
+ ```scss
35
+ #logo {
36
+ @include hidpi-image (logo, 250, 188);
37
+ }
38
+ ```
39
+
40
+ If you were to want to use a `.jpg` file, it would look something like this:
41
+ ```scss
42
+ #logo {
43
+ @include hidpi-image (logo, 250, 188, jpg);
44
+ }
45
+ ```
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.2
4
+ version: 0.0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,6 +59,7 @@ files:
59
59
  - stylesheets/stipe/_grid.scss
60
60
  - stylesheets/stipe/_manifest.scss
61
61
  - stylesheets/stipe/_media.scss
62
+ - stylesheets/stipe/_plug-ins.scss
62
63
  - stylesheets/stipe/_stipe.scss
63
64
  - stylesheets/stipe/_typography.scss
64
65
  - stylesheets/stipe/buttons/_extends.scss
@@ -85,6 +86,8 @@ files:
85
86
  - stylesheets/stipe/grid/lib/_push_logic.scss
86
87
  - stylesheets/stipe/grid/lib/_the_grid.scss
87
88
  - stylesheets/stipe/grid/readme.md
89
+ - stylesheets/stipe/plug-ins/_hidpi.scss
90
+ - stylesheets/stipe/plug-ins/readme.md
88
91
  - stylesheets/stipe/resets/_eric_meyer.scss
89
92
  - stylesheets/stipe/resets/_toadstool.scss
90
93
  - stylesheets/stipe/stipe/_extends.scss