Skip to content

Commit b688df9

Browse files
committedJan 8, 2016
deliver different images depending on a media request
1 parent 76dea97 commit b688df9

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed
 

‎_layouts/post.html

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<div class="post-image-image" style="background-image: url({% if page.image %}{{ page.image }}{% endif %})">
1313
Article Image
1414
</div>
15+
<div class="post-image-image2" style="background-image: url({% if page.image2 %}{{ page.image2 }}{% endif %})">
16+
Article Image
17+
</div>
1518
<div class="post-meta">
1619
<h1 class="post-title">{{ page.title }}</h1>
1720
<div class="cf post-meta-text">

‎_posts/2014-11-30-mediator_features.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ date: 2014-11-30 14:34:25
55
categories: mediator feature
66
tags: featured
77
image: /assets/article_images/2014-11-30-mediator_features/night-track.JPG
8+
image2: /assets/article_images/2014-11-30-mediator_features/night-track-mobile.JPG
89
---
910
#Mediator Formats and CSS features
1011

Loading

‎css/main.sass

+26-10
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,32 @@ body
240240
right: 0
241241
bottom: 0
242242
overflow: hidden
243-
.post-image-image
244-
background-size: cover
245-
position: absolute
246-
top: 0
247-
left: 0
248-
right: 0
249-
bottom: 0
250-
text-indent: -9999px
251-
padding-top: 33%
252-
z-index: 1
243+
@media(min-width: 700px)
244+
.post-image-image
245+
background-size: cover
246+
position: absolute
247+
top: 0
248+
left: 0
249+
right: 0
250+
bottom: 0
251+
text-indent: -9999px
252+
padding-top: 33%
253+
z-index: 1
254+
.post-image-image2
255+
display: none
256+
@media(max-width: 700px)
257+
.post-image-image
258+
display: none
259+
.post-image-image2
260+
background-size: cover
261+
position: absolute
262+
top: 0
263+
left: 0
264+
right: 0
265+
bottom: 0
266+
text-indent: -9999px
267+
padding-top: 33%
268+
z-index: 1
253269
.post-meta
254270
position: absolute
255271
bottom: $rs*5

0 commit comments

Comments
 (0)
Please sign in to comment.