From c8805fdacf575bcfc6998d419dadcc59f4bf32a1 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Thu, 22 Aug 2024 13:05:29 +0200 Subject: [PATCH] Upgrade: Align the icons again properly on Moodle 4.4. --- CHANGES.md | 1 + lib.php | 4 +++- styles.css | 21 +-------------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dfc6077..ea3f227 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-08-22 - Upgrade: Align the icons again properly on Moodle 4.4. * 2024-08-20 - Prepare compatibility for Moodle 4.4. ### v4.3-r2 diff --git a/lib.php b/lib.php index 1b5db60..0065cef 100644 --- a/lib.php +++ b/lib.php @@ -135,8 +135,10 @@ function local_navbarplus_render_navbar_output() { $linkattributes['target'] = '_blank'; $linkattributes['rel'] = 'noopener noreferrer'; } + // Set classes. + $linkattributes = ['class' => 'nav-link position-relative icon-no-margin']; // Define classes for all icons. - $itemclasses = 'localnavbarplus nav-link'; + $itemclasses = 'localnavbarplus'; // Add optional individual classes. if (!empty($itemadditionalclasses)) { $itemclasses .= ' ' . $itemadditionalclasses; diff --git a/styles.css b/styles.css index 3a2c231..d89e7fb 100644 --- a/styles.css +++ b/styles.css @@ -1,23 +1,4 @@ -/* Float the icons left to be placed next to the existing icons "messages" and "notifications". */ -.navbar .localnavbarplus.nav-link { - float: left; -} - -/* Remove the right margin from each but the last icon to achieve the same margins for moodle and navbarplus icons. */ -.navbar .localnavbarplus.nav-link .icon { - margin-right: 0; -} -.navbar .localnavbarplus.nav-link:last-child .icon { - margin-right: .5rem; -} - -/* Do not display the icon if a user has disabled Javascript in his browser. */ +/* Do not display the reset user tour icon if a user has disabled Javascript in his browser. */ body:not(.jsenabled) #localnavbarplus-resetusertour { display: none; } - -/* Inherit the colors. */ -.navbar .localnavbarplus a, -.navbar .localnavbarplus .icon { - color: inherit; -}