From 1e6dcdc3d442297445cd0c7b7cbfd55073ee5b52 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Thu, 8 Jun 2023 15:52:42 +1000 Subject: [PATCH 1/2] MDL-78237 css: Make navbar height available for non sass-use --- theme/boost/scss/moodle/navbar.scss | 5 +++++ theme/boost/style/moodle.css | 4 ++++ theme/classic/style/moodle.css | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/theme/boost/scss/moodle/navbar.scss b/theme/boost/scss/moodle/navbar.scss index 12dade818b4..92bd367bf7d 100644 --- a/theme/boost/scss/moodle/navbar.scss +++ b/theme/boost/scss/moodle/navbar.scss @@ -169,3 +169,8 @@ .pagelayout-embedded #page { margin-top: 0; } + +// Make navbar height available for non-sass use. +:root { + --navbar-height: #{$navbar-height}; +} diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index eea9d8d2922..69409ee146e 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -36881,6 +36881,10 @@ div.editor_atto_toolbar button .icon { margin-top: 0; } +:root { + --navbar-height: 60px; +} + /** * Reportbuilder. */ diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 274b5a91c24..4870ce7863d 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -36815,6 +36815,10 @@ div.editor_atto_toolbar button .icon { margin-top: 0; } +:root { + --navbar-height: 50px; +} + /** * Reportbuilder. */ From 5b9a4522630b86d759ea23b5ac8fd00737550808 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Thu, 8 Jun 2023 15:56:30 +1000 Subject: [PATCH 2/2] MDL-78237 editor_tiny: Prevent navbar obscuring modal content --- lib/editor/tiny/styles.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/editor/tiny/styles.css b/lib/editor/tiny/styles.css index f4508b8e45d..bbca493c270 100644 --- a/lib/editor/tiny/styles.css +++ b/lib/editor/tiny/styles.css @@ -21,3 +21,15 @@ .tox.tox-tinymce .tox-toolbar__group { padding-right: 0; } + +/* Prevent navbar obscuring modal content (ignores fullscreen). */ +.tox.tox-tinymce:not(.tox-fullscreen) + .tox .tox-dialog-wrap { + padding-top: var(--navbar-height); +} + +/* Modify Tiny's max-height calculation here to factor in navbar height on small viewports (ignores fullscreen). */ +@media only screen and (max-width: 767px) { + body:not(.tox-force-desktop) .tox.tox-tinymce:not(.tox-fullscreen) + .tox .tox-dialog-wrap .tox-dialog { + max-height: calc((100vh - 8px * 2) - var(--navbar-height)) !important; /* stylelint-disable-line declaration-no-important */ + } +}