background-color: var(--code-note-background-color);
}
-/* Image. Ensure everything is done for both <img> and <svg>. */
-img.m-image, svg.m-image {
+/* Image. Ensure everything is done for <img>, <svg> and <video> as well. */
+img.m-image, svg.m-image, video.m-image {
display: block;
margin-left: auto;
margin-right: auto;
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img, div.m-image svg {
+img.m-image, svg.m-image, video.m-image,
+div.m-image img, div.m-image svg, div.m-image video {
max-width: 100%;
border-radius: var(--border-radius);
}
-div.m-image.m-fullwidth img, div.m-image.m-fullwidth svg {
+div.m-image.m-fullwidth img,
+div.m-image.m-fullwidth svg,
+div.m-image.m-fullwidth video {
width: 100%;
}
/* Image badge. Deliberately omitting <svg> since I don't see any use for those
- as avatars yet. */
+ as avatars yet, <video> as well. */
img.m-image.m-badge, div.m-image.m-badge img {
border-radius: 50%;
}
-/* Figure. Ensure everything is done for both <img> and <svg>. */
+/* Figure. Ensure everything is done for <img>, <svg> and <video> as well. */
figure.m-figure {
max-width: 100%;
margin-top: 0;
priority than this */
margin-bottom: 1rem !important;
}
-figure.m-figure img, figure.m-figure svg {
+figure.m-figure img,
+figure.m-figure svg,
+figure.m-figure video {
position: relative; /* so it's above the border */
margin-left: 0;
margin-right: 0;
border-top-right-radius: var(--border-radius);
max-width: 100%;
}
-figure.m-figure.m-flat img, figure.m-figure.m-flat svg {
+figure.m-figure.m-flat img,
+figure.m-figure.m-flat svg,
+figure.m-figure.m-flat video {
border-bottom-left-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
}
-figure.m-figure a img, figure.m-figure a svg {
+figure.m-figure a img,
+figure.m-figure a svg,
+figure.m-figure a video {
margin-left: -1rem;
margin-right: -1rem;
}
/* otherwise figure with clickable image is centered differently */
display: inline;
}
-figure.m-figure.m-fullwidth img, figure.m-figure.m-fullwidth svg {
+figure.m-figure.m-fullwidth img,
+figure.m-figure.m-fullwidth svg,
+figure.m-figure.m-fullwidth video {
width: 100%;
}
figure.m-figure.m-fullwidth::after {
table.m-table th.m-dim pre, table.m-table th.m-dim code {
background-color: rgba(34, 39, 46, 0.5);
}
-img.m-image, svg.m-image {
+img.m-image, svg.m-image, video.m-image {
display: block;
margin-left: auto;
margin-right: auto;
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img, div.m-image svg {
+img.m-image, svg.m-image, video.m-image,
+div.m-image img, div.m-image svg, div.m-image video {
max-width: 100%;
border-radius: 0.2rem;
}
-div.m-image.m-fullwidth img, div.m-image.m-fullwidth svg {
+div.m-image.m-fullwidth img,
+div.m-image.m-fullwidth svg,
+div.m-image.m-fullwidth video {
width: 100%;
}
img.m-image.m-badge, div.m-image.m-badge img {
figure.m-figure > *:last-child {
margin-bottom: 1rem !important;
}
-figure.m-figure img, figure.m-figure svg {
+figure.m-figure img,
+figure.m-figure svg,
+figure.m-figure video {
position: relative;
margin-left: 0;
margin-right: 0;
border-top-right-radius: 0.2rem;
max-width: 100%;
}
-figure.m-figure.m-flat img, figure.m-figure.m-flat svg {
+figure.m-figure.m-flat img,
+figure.m-figure.m-flat svg,
+figure.m-figure.m-flat video {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
-figure.m-figure a img, figure.m-figure a svg {
+figure.m-figure a img,
+figure.m-figure a svg,
+figure.m-figure a video {
margin-left: -1rem;
margin-right: -1rem;
}
figure.m-figure.m-fullwidth > *:first-child {
display: inline;
}
-figure.m-figure.m-fullwidth img, figure.m-figure.m-fullwidth svg {
+figure.m-figure.m-fullwidth img,
+figure.m-figure.m-fullwidth svg,
+figure.m-figure.m-fullwidth video {
width: 100%;
}
figure.m-figure.m-fullwidth::after {
table.m-table th.m-dim pre, table.m-table th.m-dim code {
background-color: rgba(34, 39, 46, 0.5);
}
-img.m-image, svg.m-image {
+img.m-image, svg.m-image, video.m-image {
display: block;
margin-left: auto;
margin-right: auto;
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img, div.m-image svg {
+img.m-image, svg.m-image, video.m-image,
+div.m-image img, div.m-image svg, div.m-image video {
max-width: 100%;
border-radius: 0.2rem;
}
-div.m-image.m-fullwidth img, div.m-image.m-fullwidth svg {
+div.m-image.m-fullwidth img,
+div.m-image.m-fullwidth svg,
+div.m-image.m-fullwidth video {
width: 100%;
}
img.m-image.m-badge, div.m-image.m-badge img {
figure.m-figure > *:last-child {
margin-bottom: 1rem !important;
}
-figure.m-figure img, figure.m-figure svg {
+figure.m-figure img,
+figure.m-figure svg,
+figure.m-figure video {
position: relative;
margin-left: 0;
margin-right: 0;
border-top-right-radius: 0.2rem;
max-width: 100%;
}
-figure.m-figure.m-flat img, figure.m-figure.m-flat svg {
+figure.m-figure.m-flat img,
+figure.m-figure.m-flat svg,
+figure.m-figure.m-flat video {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
-figure.m-figure a img, figure.m-figure a svg {
+figure.m-figure a img,
+figure.m-figure a svg,
+figure.m-figure a video {
margin-left: -1rem;
margin-right: -1rem;
}
figure.m-figure.m-fullwidth > *:first-child {
display: inline;
}
-figure.m-figure.m-fullwidth img, figure.m-figure.m-fullwidth svg {
+figure.m-figure.m-fullwidth img,
+figure.m-figure.m-fullwidth svg,
+figure.m-figure.m-fullwidth video {
width: 100%;
}
figure.m-figure.m-fullwidth::after {
table.m-table th.m-dim pre, table.m-table th.m-dim code {
background-color: rgba(251, 240, 236, 0.5);
}
-img.m-image, svg.m-image {
+img.m-image, svg.m-image, video.m-image {
display: block;
margin-left: auto;
margin-right: auto;
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img, div.m-image svg {
+img.m-image, svg.m-image, video.m-image,
+div.m-image img, div.m-image svg, div.m-image video {
max-width: 100%;
border-radius: 0.2rem;
}
-div.m-image.m-fullwidth img, div.m-image.m-fullwidth svg {
+div.m-image.m-fullwidth img,
+div.m-image.m-fullwidth svg,
+div.m-image.m-fullwidth video {
width: 100%;
}
img.m-image.m-badge, div.m-image.m-badge img {
figure.m-figure > *:last-child {
margin-bottom: 1rem !important;
}
-figure.m-figure img, figure.m-figure svg {
+figure.m-figure img,
+figure.m-figure svg,
+figure.m-figure video {
position: relative;
margin-left: 0;
margin-right: 0;
border-top-right-radius: 0.2rem;
max-width: 100%;
}
-figure.m-figure.m-flat img, figure.m-figure.m-flat svg {
+figure.m-figure.m-flat img,
+figure.m-figure.m-flat svg,
+figure.m-figure.m-flat video {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
-figure.m-figure a img, figure.m-figure a svg {
+figure.m-figure a img,
+figure.m-figure a svg,
+figure.m-figure a video {
margin-left: -1rem;
margin-right: -1rem;
}
figure.m-figure.m-fullwidth > *:first-child {
display: inline;
}
-figure.m-figure.m-fullwidth img, figure.m-figure.m-fullwidth svg {
+figure.m-figure.m-fullwidth img,
+figure.m-figure.m-fullwidth svg,
+figure.m-figure.m-fullwidth video {
width: 100%;
}
figure.m-figure.m-fullwidth::after {
table.m-table th.m-dim pre, table.m-table th.m-dim code {
background-color: rgba(251, 240, 236, 0.5);
}
-img.m-image, svg.m-image {
+img.m-image, svg.m-image, video.m-image {
display: block;
margin-left: auto;
margin-right: auto;
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img, div.m-image svg {
+img.m-image, svg.m-image, video.m-image,
+div.m-image img, div.m-image svg, div.m-image video {
max-width: 100%;
border-radius: 0.2rem;
}
-div.m-image.m-fullwidth img, div.m-image.m-fullwidth svg {
+div.m-image.m-fullwidth img,
+div.m-image.m-fullwidth svg,
+div.m-image.m-fullwidth video {
width: 100%;
}
img.m-image.m-badge, div.m-image.m-badge img {
figure.m-figure > *:last-child {
margin-bottom: 1rem !important;
}
-figure.m-figure img, figure.m-figure svg {
+figure.m-figure img,
+figure.m-figure svg,
+figure.m-figure video {
position: relative;
margin-left: 0;
margin-right: 0;
border-top-right-radius: 0.2rem;
max-width: 100%;
}
-figure.m-figure.m-flat img, figure.m-figure.m-flat svg {
+figure.m-figure.m-flat img,
+figure.m-figure.m-flat svg,
+figure.m-figure.m-flat video {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
-figure.m-figure a img, figure.m-figure a svg {
+figure.m-figure a img,
+figure.m-figure a svg,
+figure.m-figure a video {
margin-left: -1rem;
margin-right: -1rem;
}
figure.m-figure.m-fullwidth > *:first-child {
display: inline;
}
-figure.m-figure.m-fullwidth img, figure.m-figure.m-fullwidth svg {
+figure.m-figure.m-fullwidth img,
+figure.m-figure.m-fullwidth svg,
+figure.m-figure.m-fullwidth video {
width: 100%;
}
figure.m-figure.m-fullwidth::after {
`Images`_
=========
-Putting :css:`.m-image` class onto an :html:`<img>` / :html:`<svg>` tag makes
-the image centered, slightly rounded and sets its max width to 100%. Adding
-:css:`.m-fullwidth` on the image element works as expected. For accessibility
-reasons it's a good practice to include the ``alt`` attribute.
+Putting :css:`.m-image` class onto an :html:`<img>`, :html:`<svg>` or
+:html:`<video>` tag makes the image or video centered, slightly rounded and
+sets its max width to 100%. Adding :css:`.m-fullwidth` on the image element
+works as expected. For accessibility reasons it's a good practice to include
+the ``alt`` attribute.
.. code-figure::
For avatars, similarly to the `Badges`_ above, applying a :css:`.m-badge` class
together with :css:`.m-image` will make the image round. Works for both plain
:html:`<img>` and clickable images wrapped in :html:`<div class="m-image">`.
+The :css:`.m-badge` isn't recognized for :html:`<svg>` or :html:`<video>`
+however.
.. code-figure::
:html:`<figcaption>` element. Inside it, there can optionally be a longer
description wrapped in a :css:`div.m-figure-description` element. The
:css:`.m-fullwidth` class works here too and you can also wrap the
-:html:`<img>` / :html:`<svg>` element in an :html:`<a>` tag to make it
-clickable.
+:html:`<img>` / :html:`<svg>` / :html:`<video>` element in an :html:`<a>` tag
+to make it clickable.
Figure always expects at least the caption to be present. If you want just an
image, use the plain image tag. If you have a lot of figures on the page and