From 60a4bf5bcc9cad8eea261ce68141515e443da552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Fri, 8 Mar 2024 12:58:40 +0100 Subject: [PATCH] MDL-81110 theme_boost: Fix scroll-margin-top in #maincontent - Fix scroll-margin-top in #maincontent element - Add scroll-margin-top for focused elements too --- theme/boost/scss/moodle/core.scss | 2 +- theme/boost/scss/moodle/drawer.scss | 3 ++- theme/boost/style/moodle.css | 5 +++-- theme/classic/style/moodle.css | 5 +++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index 80e5a3635ba..cc02b51d0f1 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -393,7 +393,7 @@ img.activityicon { #maincontent { display: block; height: 1px; - overflow: hidden; + overflow: clip; } img.uihint { diff --git a/theme/boost/scss/moodle/drawer.scss b/theme/boost/scss/moodle/drawer.scss index a57de7fbe13..cf3b20e50aa 100644 --- a/theme/boost/scss/moodle/drawer.scss +++ b/theme/boost/scss/moodle/drawer.scss @@ -11,7 +11,8 @@ $drawer-bg-color: $gray-100 !default; $drawer-scroll-bg-track: $gray-100 !default; $drawer-shadow-color: rgba(0, 0, 0, .25) !default; -:target { +:target, +:focus { scroll-margin-top: $fixed-header-y + 10px; } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index b7ee36ca085..a477a20ad30 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -23282,7 +23282,7 @@ img.activityicon { #maincontent { display: block; height: 1px; - overflow: hidden; + overflow: clip; } img.uihint { @@ -29748,7 +29748,8 @@ span.editinstructions .alert-link { } /* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */ -:target { +:target, +:focus { scroll-margin-top: 70px; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 20cd8dfe65d..a28fbf84eb9 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -23282,7 +23282,7 @@ img.activityicon { #maincontent { display: block; height: 1px; - overflow: hidden; + overflow: clip; } img.uihint { @@ -29748,7 +29748,8 @@ span.editinstructions .alert-link { } /* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */ -:target { +:target, +:focus { scroll-margin-top: 60px; }