Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caption in Media Block #487

Merged
merged 2 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/_patterns/01-molecules/blocks/media-block.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"date": "December 28, 2018",
"description": "Mauris sit amet augue gravida, dignissim sem maximus, aliquam metus. Maecenas eu consectetur orci, id auctor dui.",
"category": "Culture",
"url": "/"
"url": "/",
"caption": "Aliquam erat volutpat. Etiam dui dui, molestie et pulvinar eget, malesuada vitae dui. Nunc non est pulvinar, lacinia augue sit amet, efficitur libero."
}
}
3 changes: 3 additions & 0 deletions source/_patterns/01-molecules/blocks/media-block.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<button href="{{ media_block_default.picture.video.link }}" class="o-button o-button--outline o-button--outline--white"><span class="u-icon u-icon--xs u-space--half--right">{% include '@atoms/icons/icon-play.twig' %}</span>Watch Video</button>
</div>
{% endif %}
{% if media_block_default.caption %}
<div class="c-block__caption u-padding--top u-padding--bottom u-color--white-transparent {% if media_block_default.block_type %}u-padding--right u-padding--quad--left{% else %}u-padding--sides{% endif %}">{{ media_block_default.caption }}</div>
{% endif %}
</div>
</div>
<!-- image -->
Expand Down
11 changes: 11 additions & 0 deletions source/css/_objects.blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@
align-items: flex-end;
}

.c-block__caption {
background-color: transparent;
background-image: linear-gradient(to bottom, rgba(0, 41, 56, 0), rgba(0, 41, 56, 0.9));
position: absolute;
bottom: 0;
font-size: 90%;
}

/**
* Block Variations
*/
Expand Down Expand Up @@ -237,6 +245,9 @@
display: block;
margin-right: $space-mobile;
}
.c-block__caption {
display: none;
}
}
}

Expand Down