Style diagrams based on intended size

This commit is contained in:
Tim Bannister
2021-10-17 21:31:27 +01:00
parent e9cee7345b
commit 1fe561a4de
+42
View File
@@ -673,3 +673,45 @@ body.td-documentation {
font-size: inherit !important;
}
}
/* Force size constraints on figures */
figure {
&.diagram-small img {
max-height: clamp(20mm,12em,80vh);
margin-left: auto;
margin-right: auto;
display: block;
}
&.diagram-medium img {
max-height: clamp(25mm,20em,80vh);
margin-left: auto;
margin-right: auto;
display: block;
}
&.diagram-large img {
max-width: clamp(0vw, 95vw, 100%);
max-height: calc(80vh - 8rem);
}
}
@media only screen and (min-width: 768px) {
figure {
&.diagram-small, &.diagram-medium {
max-width: 80%;
}
&.diagram-large {
max-width: 100%;
width: 100%;
}
&.diagram-small img {
max-width: clamp(30rem, 45ch, 100mm);
}
&.diagram-medium img {
max-width: clamp(50rem, 20ch, 160mm);
}
&.diagram-large img {
max-width: clamp(25vw, 95vw, 100%);
max-height: calc(100vh - 10rem);
}
}
}