aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2019-10-26 11:48:51 +0000
committers-ol <s-ol@users.noreply.github.com>2019-10-26 11:48:51 +0000
commitb23af2ff33e920d3994ad4b603221c4a208c5cde (patch)
tree224199e51cc95d92d6c124e862dc5b26cd9379c9
parentimplement children ordering in stores.fs (diff)
downloadmmm-b23af2ff33e920d3994ad4b603221c4a208c5cde.tar.gz
mmm-b23af2ff33e920d3994ad4b603221c4a208c5cde.zip
adjust mermaid-diagram size to content width
-rw-r--r--mmm/mmmfs/converts.moon3
-rw-r--r--scss/_content.scss3
2 files changed, 6 insertions, 0 deletions
diff --git a/mmm/mmmfs/converts.moon b/mmm/mmmfs/converts.moon
index c1f7cea..f098448 100644
--- a/mmm/mmmfs/converts.moon
+++ b/mmm/mmmfs/converts.moon
@@ -376,6 +376,9 @@ if MODE == 'CLIENT' and window.mermaid
with container = document\createElement 'div'
cb = (svg) =>
.innerHTML = svg
+ .firstElementChild.style.width = '100%'
+ .firstElementChild.style.height = 'auto'
+
window\setImmediate (_) ->
window.mermaid\render id, source, cb, container
}
diff --git a/scss/_content.scss b/scss/_content.scss
index 708685f..66b9f42 100644
--- a/scss/_content.scss
+++ b/scss/_content.scss
@@ -8,6 +8,8 @@
.markdown > p,
.markdown > p > a,
.markdown > a {
+ max-width: 100%;
+
> img, > video {
display: block;
max-width: 100%;
@@ -21,6 +23,7 @@
.embed {
width: inherit;
height: inherit;
+ max-width: inherit;
.description {
text-align: center;