1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00
danbarberphoto/app/views/shared/_photo_styles.html.erb

23 lines
694 B
Plaintext

<style type="text/css">
<% photos.each do |photo| %>
<% if photo.image.present? %>
#<%= photo.name.parameterize %>.sg-<%= size %> {
background: url(<%= photo.image.url(:"size#{size}") %>);
}
<% end %>
<% end %>
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
<% photos.each do |photo| %>
<% if photo.image.present? %>
#<%= photo.name.parameterize %>.sg-<%= size %> {
background: url(<%= photo.image.url(:"size#{size}x2") %>);
background-size: 100%;
}
<% end %>
<% end %>
}
</style>