background-color: var(--dim-button-active-color);
}
-/* Image */
+/* Image. Ensure everything is done for both <img> and <svg>. */
img.m-image, svg.m-image {
display: block;
margin-left: auto;
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img {
+img.m-image, svg.m-image, div.m-image img, div.m-image svg {
max-width: 100%;
border-radius: var(--border-radius);
}
width: 100%;
}
-/* Figure */
+/* Figure. Ensure everything is done for both <img> and <svg>. */
figure.m-figure {
max-width: 100%;
margin-top: 0;
caption-side: bottom;
}
figure.m-figure > *:first-child {
- /* otherwise figure with clickable image is center differently */
+ /* otherwise figure with clickable image is centered differently */
display: inline;
}
figure.m-figure > *:last-child {
margin-bottom: 1rem;
}
-figure.m-figure img {
+figure.m-figure img, figure.m-figure svg {
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 img, figure.m-figure.m-flat svg {
border-bottom-left-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
}
font-weight: var(--heading-font-weight);
font-size: 1.17rem; /* taken from webkit defaults for h3 */
}
-figure.m-figure a img {
+figure.m-figure a img, figure.m-figure a svg {
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 img, figure.m-figure.m-fullwidth svg {
width: 100%;
}
figure.m-figure.m-fullwidth:after {
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img {
+img.m-image, svg.m-image, div.m-image img, div.m-image svg {
max-width: 100%;
border-radius: 0.2rem;
}
figure.m-figure > *:last-child {
margin-bottom: 1rem;
}
-figure.m-figure img {
+figure.m-figure img, figure.m-figure svg {
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 img, figure.m-figure.m-flat svg {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
font-weight: 600;
font-size: 1.17rem;
}
-figure.m-figure a img {
+figure.m-figure a img, figure.m-figure a svg {
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 img, figure.m-figure.m-fullwidth svg {
width: 100%;
}
figure.m-figure.m-fullwidth:after {
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img {
+img.m-image, svg.m-image, div.m-image img, div.m-image svg {
max-width: 100%;
border-radius: 0.2rem;
}
figure.m-figure > *:last-child {
margin-bottom: 1rem;
}
-figure.m-figure img {
+figure.m-figure img, figure.m-figure svg {
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 img, figure.m-figure.m-flat svg {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
font-weight: 600;
font-size: 1.17rem;
}
-figure.m-figure a img {
+figure.m-figure a img, figure.m-figure a svg {
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 img, figure.m-figure.m-fullwidth svg {
width: 100%;
}
figure.m-figure.m-fullwidth:after {
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img {
+img.m-image, svg.m-image, div.m-image img, div.m-image svg {
max-width: 100%;
border-radius: 0.2rem;
}
figure.m-figure > *:last-child {
margin-bottom: 1rem;
}
-figure.m-figure img {
+figure.m-figure img, figure.m-figure svg {
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 img, figure.m-figure.m-flat svg {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
font-weight: normal;
font-size: 1.17rem;
}
-figure.m-figure a img {
+figure.m-figure a img, figure.m-figure a svg {
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 img, figure.m-figure.m-fullwidth svg {
width: 100%;
}
figure.m-figure.m-fullwidth:after {
div.m-image {
text-align: center;
}
-img.m-image, svg.m-image, div.m-image img {
+img.m-image, svg.m-image, div.m-image img, div.m-image svg {
max-width: 100%;
border-radius: 0.2rem;
}
figure.m-figure > *:last-child {
margin-bottom: 1rem;
}
-figure.m-figure img {
+figure.m-figure img, figure.m-figure svg {
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 img, figure.m-figure.m-flat svg {
border-bottom-left-radius: 0.2rem;
border-bottom-right-radius: 0.2rem;
}
font-weight: normal;
font-size: 1.17rem;
}
-figure.m-figure a img {
+figure.m-figure a img, figure.m-figure a svg {
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 img, figure.m-figure.m-fullwidth svg {
width: 100%;
}
figure.m-figure.m-fullwidth:after {
:html:`<figcaption>` element. The description is optional, but should be
wrapped in some tag as well (for example a :html:`<span>`). The
:css:`.m-fullwidth` class works here too and you can also wrap the
-:html:`<img>` element in an :html:`<a>` tag to make it clickable.
+:html:`<img>` / :html:`<svg>` 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