Issue #2938187 by markconroy, andrewmacpherson: Homepage/Recipes page banner image is duplicating on small screens

merge-requests/1654/head
Lee Rowlands 2018-01-23 14:06:38 +10:00
parent d2767fd187
commit b7ec9fab52
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
2 changed files with 6 additions and 9 deletions

View File

@ -3,15 +3,8 @@
* This file is used to style the banner block.
*/
.cover-image {
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
.block-banner-block {
background-size: 0 0;
background-position: 0 0;
}
.block-banner-block .summary {
@ -56,8 +49,10 @@
/* 768px */
@media screen and (min-width: 48rem) { /* 768px */
.block-banner-block {
background-color: #464646;
background-size: cover;
background-position: left center;
background-repeat: no-repeat;
/* Image ratio 7:3 */
}

View File

@ -35,7 +35,9 @@
]
%}
<div{{ attributes.addClass(classes) }} style="background-image: url({{ file_url(content.field_banner_image.0['#item'].entity.uri.value) }})">
{% set background_image = file_url(content.field_banner_image.0['#item'].entity.uri.value) %}
<div{{ attributes.addClass(classes) }} style="background-image: url({{ background_image }})">
<div class="block-inner">
{{ title_prefix }}
{% if label %}
@ -45,7 +47,7 @@
{% block content %}
{{ content.field_banner_image }}
<div class="summary">
{{ content }}
{{ content|without('field_banner_image') }}
</div>
{% endblock %}
</div>