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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add p-media-container class #5012

Merged
merged 6 commits into from
Mar 7, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vanilla-framework",
"version": "4.8.1",
"version": "4.9.0",
"author": {
"email": "webteam@canonical.com",
"name": "Canonical Webteam"
Expand Down
6 changes: 6 additions & 0 deletions releases.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- version: 4.9.0
features:
- component: Images
url: /docs/patterns/images#media-element-with-spacing
status: New
notes: We've introduced a way to add spacing above a media element.
- version: 4.8.0
features:
- component: Themes
Expand Down
5 changes: 5 additions & 0 deletions scss/_patterns_media-container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@mixin vf-p-media-container {
.p-media-container {
margin-top: $spv--small;
}
}
2 changes: 2 additions & 0 deletions scss/_vanilla.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@import 'patterns_lists';
@import 'patterns_logo-section';
@import 'patterns_matrix';
@import 'patterns_media-container';
@import 'patterns_media-object';
@import 'patterns_modal';
@import 'patterns_muted-heading';
Expand Down Expand Up @@ -119,6 +120,7 @@
@include vf-p-lists;
@include vf-p-logo-section;
@include vf-p-matrix;
@include vf-p-media-container;
@include vf-p-media-object;
@include vf-p-modal;
@include vf-p-muted-heading;
Expand Down
5 changes: 5 additions & 0 deletions scss/standalone/patterns_media-container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import '../vanilla';
@include vf-base;

@include vf-p-rule;
@include vf-p-media-container;
11 changes: 11 additions & 0 deletions templates/docs/examples/patterns/image/spacing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "_layouts/examples.html" %}
{% block title %}Image / Spacing{% endblock %}

{% block standalone_css %}base{% endblock %}
petesfrench marked this conversation as resolved.
Show resolved Hide resolved

{% block content %}
<hr class="p-rule">
<div class="p-media-container">
<img src="https://assets.ubuntu.com/v1/584903f3-iot-drone.png" alt="">
</div>
{% endblock %}
8 changes: 8 additions & 0 deletions templates/docs/patterns/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ When an image needs a caption, it can be wrapped in a `<figure>` element, along
View example of image with a caption
</a></div>

## Media element with spacing

Adds spacing to the top of a media element. This is usually needed when image or video is placed below the horizontal rule component to avoid media touching the line.

<div class="embedded-example"><a href="/docs/examples/patterns/image/spacing/" class="js-example">
View example of media element with spacing
</a></div>

## Import

To import just this component into your project, copy the snippet below and include it in your main Sass file.
Expand Down