Skip to content

Commit

Permalink
added fallback example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianmandrup committed Aug 16, 2012
1 parent a8269e3 commit 831d2a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -32,6 +32,8 @@ The above can be rendered in Rails 3+ by writing the following code, using the V
= picture_src 'medium_x2.jpg', "(min-width: 400px) and (min-device-pixel-ratio: 2.0)" = picture_src 'medium_x2.jpg', "(min-width: 400px) and (min-device-pixel-ratio: 2.0)"
= picture_src 'largs.jpg', "(min-width: 800px)" = picture_src 'largs.jpg', "(min-width: 800px)"
= picture_src 'large_x2.jpg', "(min-width: 800px) and (min-device-pixel-ratio: 2.0)" = picture_src 'large_x2.jpg', "(min-width: 800px) and (min-device-pixel-ratio: 2.0)"
# ...
= picture_fallback "external/imgs/small.jpg", alt: "A giant stone face at The Bayon temple in Angkor Thom, Cambodia"
``` ```


Note: This example uses [HAML](https://github.com/haml/haml) as the rendering engine. Note: This example uses [HAML](https://github.com/haml/haml) as the rendering engine.
Expand All @@ -45,6 +47,8 @@ Using conventions, and an extra `ratio:` option, the following shorthand is poss
= picture_src 'small.jpg', ratio: 'x2' = picture_src 'small.jpg', ratio: 'x2'
= picture_src 'medium.jpg', "400", ratio: 'x2' = picture_src 'medium.jpg', "400", ratio: 'x2'
= picture_src 'large.jpg', "800", ratio: 'x2' = picture_src 'large.jpg', "800", ratio: 'x2'
# ...
= picture_fallback "external/imgs/small.jpg", alt: "A giant stone face at The Bayon temple in Angkor Thom, Cambodia"
``` ```


This will ouput exactly the same HTML as the previous example :) This will ouput exactly the same HTML as the previous example :)
Expand Down

0 comments on commit 831d2a5

Please sign in to comment.