From f874652ad2252eee8f6d4fde9e1fd64babab4075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Fri, 19 Mar 2021 15:11:50 +0100 Subject: [PATCH] MDL-71152 theme_boost: Use 'scroll-margin-top' for anchor links Current anchor link offset fix is not working with 'display:flex' elements --- admin/tool/task/styles.css | 4 ---- theme/boost/scss/moodle/drawer.scss | 9 ++------- theme/boost/style/moodle.css | 11 ++--------- theme/classic/style/moodle.css | 11 ++--------- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/admin/tool/task/styles.css b/admin/tool/task/styles.css index 7f37541c7ec..f297fd6afaf 100644 --- a/admin/tool/task/styles.css +++ b/admin/tool/task/styles.css @@ -15,7 +15,3 @@ #page-admin-tool-task-scheduledtasks .task-clearfaildelay { font-size: 0.75em; } - -#page-admin-tool-task-scheduledtasks :target { - scroll-margin-top: 60px; -} diff --git a/theme/boost/scss/moodle/drawer.scss b/theme/boost/scss/moodle/drawer.scss index 365fad85ce8..42ec734e122 100644 --- a/theme/boost/scss/moodle/drawer.scss +++ b/theme/boost/scss/moodle/drawer.scss @@ -6,13 +6,8 @@ $drawer-padding-x: 20px !default; $drawer-padding-y: 20px !default; $drawer-offscreen-gutter: 20px !default; -:target::before { - content: " "; - display: block; - height: ($fixed-header-y + 10px); /* fixed header height*/ - margin-top: -($fixed-header-y + 10px); /* negative fixed header height */ - width: 1px; - pointer-events: none; +:target { + scroll-margin-top: $fixed-header-y + 10px; } .pagelayout-embedded :target { diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 396c790d630..3988c10cd3e 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -14200,15 +14200,8 @@ span.editinstructions { font-size: 100%; } /* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */ -:target::before { - content: " "; - display: block; - height: 60px; - /* fixed header height*/ - margin-top: -60px; - /* negative fixed header height */ - width: 1px; - pointer-events: none; } +:target { + scroll-margin-top: 60px; } .pagelayout-embedded :target { padding-top: initial; diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index c0337ce9daa..32b22ef6659 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -14423,15 +14423,8 @@ span.editinstructions { font-size: 100%; } /* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */ -:target::before { - content: " "; - display: block; - height: 60px; - /* fixed header height*/ - margin-top: -60px; - /* negative fixed header height */ - width: 1px; - pointer-events: none; } +:target { + scroll-margin-top: 60px; } .pagelayout-embedded :target { padding-top: initial;