From b23af2ff33e920d3994ad4b603221c4a208c5cde Mon Sep 17 00:00:00 2001 From: s-ol Date: Sat, 26 Oct 2019 13:48:51 +0200 Subject: adjust mermaid-diagram size to content width --- mmm/mmmfs/converts.moon | 3 +++ scss/_content.scss | 3 +++ 2 files changed, 6 insertions(+) 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; -- cgit v1.2.3