From 8d54a86bdbc66b7c2a92d079c6307f04a7ca282d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Thu, 20 Jun 2024 09:41:49 +0200 Subject: [PATCH] MDL-81819 theme_boost: Refactor .close usages for BS5 - Add .btn-close to the Boostratp 5 bridge SCSS file - Replace .close occurrences with .btn-close - Fix styles using .close --- .../content/library/moodle-javascript.md | 2 +- .../moodle/components/notifications.md | 2 +- enrol/yui/rolemanager/rolemanager.js | 4 +- .../local/process_monitor/monitor.mustache | 2 +- .../local/process_monitor/process.mustache | 2 +- lib/templates/local/toast/message.mustache | 2 +- lib/templates/modal.mustache | 2 +- .../send_activity_modal_base.mustache | 2 +- lib/templates/notification_base.mustache | 2 +- ...iew_conversation_header_edit_mode.mustache | 2 +- theme/boost/scss/moodle/bs5-bridge.scss | 4 ++ theme/boost/scss/moodle/core.scss | 4 +- theme/boost/scss/moodle/modal.scss | 2 +- theme/boost/scss/moodle/search.scss | 3 ++ theme/boost/scss/moodle/toasts.scss | 2 +- theme/boost/style/moodle.css | 47 ++++++++++--------- theme/classic/style/moodle.css | 47 ++++++++++--------- 17 files changed, 72 insertions(+), 59 deletions(-) diff --git a/admin/tool/componentlibrary/content/library/moodle-javascript.md b/admin/tool/componentlibrary/content/library/moodle-javascript.md index cc3f178aa77..dae1c335b3d 100644 --- a/admin/tool/componentlibrary/content/library/moodle-javascript.md +++ b/admin/tool/componentlibrary/content/library/moodle-javascript.md @@ -19,7 +19,7 @@ In order for this to work you need to use the JavaScript syntax used in core Mus PlaceKitten Bootstrap 11 mins ago - diff --git a/admin/tool/componentlibrary/content/moodle/components/notifications.md b/admin/tool/componentlibrary/content/moodle/components/notifications.md index d323dd9488a..518a62f7b58 100644 --- a/admin/tool/componentlibrary/content/moodle/components/notifications.md +++ b/admin/tool/componentlibrary/content/moodle/components/notifications.md @@ -18,7 +18,7 @@ Notifications are coupled with actions and provide instant feedback to the actio {{< example show_markup="false">}} {{< /example >}} diff --git a/enrol/yui/rolemanager/rolemanager.js b/enrol/yui/rolemanager/rolemanager.js index d4a139737e4..ac4c3bf44b6 100644 --- a/enrol/yui/rolemanager/rolemanager.js +++ b/enrol/yui/rolemanager/rolemanager.js @@ -362,7 +362,7 @@ YUI.add('moodle-enrol-rolemanager', function(Y) { var i, m = this.get(MANIPULATOR); var element = Y.Node.create('
' + '
' + - '
' + '
' + '

'+M.util.get_string('assignroles', 'role')+'

' + @@ -381,7 +381,7 @@ YUI.add('moodle-enrol-rolemanager', function(Y) { Y.one(document.body).append(element); this.set('elementNode', element); this.set('contentNode', content); - element.one('.header .close').on('click', this.hide, this); + element.one('.header .btn-close').on('click', this.hide, this); }, display : function(user) { var currentroles = user.get(CURRENTROLES), node = null; diff --git a/lib/templates/local/process_monitor/monitor.mustache b/lib/templates/local/process_monitor/monitor.mustache index ef0e5fd05dc..3e1c7588736 100644 --- a/lib/templates/local/process_monitor/monitor.mustache +++ b/lib/templates/local/process_monitor/monitor.mustache @@ -41,7 +41,7 @@ {{/closeButton}} diff --git a/lib/templates/modal.mustache b/lib/templates/modal.mustache index 0430b1aacc8..e79002312be 100644 --- a/lib/templates/modal.mustache +++ b/lib/templates/modal.mustache @@ -48,7 +48,7 @@ {{$header}} {{/header}} -
diff --git a/lib/templates/moodlenet/send_activity_modal_base.mustache b/lib/templates/moodlenet/send_activity_modal_base.mustache index 44c8a8d67b2..b40eaaeac15 100644 --- a/lib/templates/moodlenet/send_activity_modal_base.mustache +++ b/lib/templates/moodlenet/send_activity_modal_base.mustache @@ -33,7 +33,7 @@ {{#str}} moodlenet:sharetomoodlenet, moodle {{/str}}
- diff --git a/lib/templates/notification_base.mustache b/lib/templates/notification_base.mustache index df377029342..feb114ef5da 100644 --- a/lib/templates/notification_base.mustache +++ b/lib/templates/notification_base.mustache @@ -45,7 +45,7 @@ }}{{# announce }} role="alert" data-aria-autofocus="true"{{/ announce }}> {{{ message }}} {{# closebutton }}{{! - }}{{! diff --git a/message/templates/message_drawer_view_conversation_header_edit_mode.mustache b/message/templates/message_drawer_view_conversation_header_edit_mode.mustache index 31df07817c5..beed0d08c74 100644 --- a/message/templates/message_drawer_view_conversation_header_edit_mode.mustache +++ b/message/templates/message_drawer_view_conversation_header_edit_mode.mustache @@ -38,7 +38,7 @@
{{#str}} messagesselected:, core_message {{/str}} 1 - diff --git a/theme/boost/scss/moodle/bs5-bridge.scss b/theme/boost/scss/moodle/bs5-bridge.scss index 02de1cc0d60..d33fbe819b1 100644 --- a/theme/boost/scss/moodle/bs5-bridge.scss +++ b/theme/boost/scss/moodle/bs5-bridge.scss @@ -5,3 +5,7 @@ .g-0 { @extend .no-gutters; } + +.btn-close { + @extend .close; +} diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index 6ae47838c92..2bb620ebc92 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -148,7 +148,7 @@ input[type="image"], .sr-only-focusable, a.dropdown-toggle, .moodle-dialogue-base .closebutton, -button.close, +button.btn-close, .form-autocomplete-selection, [role="treeitem"]:not([aria-expanded="true"]) { &.focus, @@ -2612,7 +2612,7 @@ $picker-emojis-per-row: 7 !default; color: darken(theme-color-level($color, $alert-color-level), 10%); } // Darken the close button text colour inside notification alerts for better contrast. - .close { + .btn-close { color: darken(theme-color-level($color, $alert-color-level), 20%); opacity: 0.6; } diff --git a/theme/boost/scss/moodle/modal.scss b/theme/boost/scss/moodle/modal.scss index d06f5725278..37edd49aa1b 100644 --- a/theme/boost/scss/moodle/modal.scss +++ b/theme/boost/scss/moodle/modal.scss @@ -17,7 +17,7 @@ } // Override Bootstrap .close for better accessibility. - .close { + .btn-close { // Adjust the margins so the focus outline does not look clipped. margin: -0.8rem -0.8rem -0.8rem auto; diff --git a/theme/boost/scss/moodle/search.scss b/theme/boost/scss/moodle/search.scss index 7dd9797cc94..8bd7eac7144 100644 --- a/theme/boost/scss/moodle/search.scss +++ b/theme/boost/scss/moodle/search.scss @@ -39,6 +39,9 @@ } .btn-close { right: 2.2rem; + opacity: inherit; + font-size: inherit; + line-height: inherit; } .btn-submit { background-color: $gray-100; diff --git a/theme/boost/scss/moodle/toasts.scss b/theme/boost/scss/moodle/toasts.scss index 7393105387e..96cbf3ec211 100644 --- a/theme/boost/scss/moodle/toasts.scss +++ b/theme/boost/scss/moodle/toasts.scss @@ -43,7 +43,7 @@ } } - .close { + .btn-close { color: inherit; } } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index de87e20c7d0..1f7e8a6e9cb 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -18092,7 +18092,7 @@ a.badge-dark:focus, a.badge-dark.focus { .alert-dismissible { padding-right: 3.90625rem; } -.alert-dismissible .close { +.alert-dismissible .close, .alert-dismissible .btn-close { position: absolute; top: 0; right: 0; @@ -18554,7 +18554,7 @@ a.badge-dark:focus, a.badge-dark.focus { border-color: #1b1e21; } -.close { +.close, .btn-close { float: right; font-size: 1.40625rem; font-weight: 700; @@ -18564,25 +18564,25 @@ a.badge-dark:focus, a.badge-dark.focus { opacity: 0.5; } @media (max-width: 1200px) { - .close { + .close, .btn-close { font-size: calc(0.950625rem + 0.6075vw); } } -.close:hover { +.close:hover, .btn-close:hover { color: #000; text-decoration: none; } -.close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus { +.close:not(:disabled):not(.disabled):hover, .btn-close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus, .btn-close:not(:disabled):not(.disabled):focus { opacity: 0.75; } -button.close { +button.close, button.btn-close { padding: 0; background-color: transparent; border: 0; } -a.close.disabled { +a.close.disabled, a.disabled.btn-close { pointer-events: none; } @@ -18747,7 +18747,7 @@ a.close.disabled { border-top-left-radius: calc(0.6rem - 1px); border-top-right-radius: calc(0.6rem - 1px); } -.modal-header .close { +.modal-header .close, .modal-header .btn-close { padding: 1rem 1rem; margin: -1rem -1rem -1rem auto; } @@ -23147,8 +23147,8 @@ a.dropdown-toggle.focus, a.dropdown-toggle:focus, .moodle-dialogue-base .closebutton.focus, .moodle-dialogue-base .closebutton:focus, -button.close.focus, -button.close:focus, +button.btn-close.focus, +button.btn-close:focus, .form-autocomplete-selection.focus, .form-autocomplete-selection:focus, [role=treeitem]:not([aria-expanded=true]).focus, @@ -23170,7 +23170,7 @@ input[type=image]:focus:hover, .sr-only-focusable:focus:hover, a.dropdown-toggle:focus:hover, .moodle-dialogue-base .closebutton:focus:hover, -button.close:focus:hover, +button.btn-close:focus:hover, .form-autocomplete-selection:focus:hover, [role=treeitem]:not([aria-expanded=true]):focus:hover { text-decoration: none; @@ -25581,7 +25581,7 @@ input[disabled] { .alert-primary a { color: #041d34; } -.alert-primary .close { +.alert-primary .btn-close { color: #000305; opacity: 0.6; } @@ -25589,7 +25589,7 @@ input[disabled] { .alert-secondary a { color: #525557; } -.alert-secondary .close { +.alert-secondary .btn-close { color: #393b3d; opacity: 0.6; } @@ -25597,7 +25597,7 @@ input[disabled] { .alert-success a, .environmenttable .ok a { color: #0c1b0b; } -.alert-success .close, .environmenttable .ok .close { +.alert-success .btn-close, .environmenttable .ok .btn-close { color: black; opacity: 0.6; } @@ -25605,7 +25605,7 @@ input[disabled] { .alert-info a { color: #00171b; } -.alert-info .close { +.alert-info .btn-close { color: black; opacity: 0.6; } @@ -25613,7 +25613,7 @@ input[disabled] { .alert-warning a, .environmenttable .warn a { color: #573e1c; } -.alert-warning .close, .environmenttable .warn .close { +.alert-warning .btn-close, .environmenttable .warn .btn-close { color: #302310; opacity: 0.6; } @@ -25621,7 +25621,7 @@ input[disabled] { .alert-danger a, .environmenttable .error a { color: #3d0f0a; } -.alert-danger .close, .environmenttable .error .close { +.alert-danger .btn-close, .environmenttable .error .btn-close { color: #110403; opacity: 0.6; } @@ -25629,7 +25629,7 @@ input[disabled] { .alert-light a { color: #686868; } -.alert-light .close { +.alert-light .btn-close { color: #4e4e4f; opacity: 0.6; } @@ -25637,7 +25637,7 @@ input[disabled] { .alert-dark a { color: #040505; } -.alert-dark .close { +.alert-dark .btn-close { color: black; opacity: 0.6; } @@ -32895,6 +32895,9 @@ body.path-question-type .mform fieldset.hidden { } .simplesearchform .btn-close { right: 2.2rem; + opacity: inherit; + font-size: inherit; + line-height: inherit; } .simplesearchform .btn-submit { background-color: #f8f9fa; @@ -37009,10 +37012,10 @@ span[data-flexitour=container][x-placement=right] div[data-role=arrow]:after, sp left: 50%; transform: translate(-50%, -50%); } -.modal .close { +.modal .btn-close { margin: -0.8rem -0.8rem -0.8rem auto; } -.modal .close:not(:disabled):not(.disabled):hover, .modal .close:not(:disabled):not(.disabled):focus { +.modal .btn-close:not(:disabled):not(.disabled):hover, .modal .btn-close:not(:disabled):not(.disabled):focus { opacity: inherit; } @@ -37763,7 +37766,7 @@ div.editor_atto_toolbar button .icon { margin: 2px 5px 0 0; content: "\f06a"; } -.toast .close { +.toast .btn-close { color: inherit; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index d01407a435e..e8f678021b7 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -18092,7 +18092,7 @@ a.badge-dark:focus, a.badge-dark.focus { .alert-dismissible { padding-right: 3.90625rem; } -.alert-dismissible .close { +.alert-dismissible .close, .alert-dismissible .btn-close { position: absolute; top: 0; right: 0; @@ -18554,7 +18554,7 @@ a.badge-dark:focus, a.badge-dark.focus { border-color: #1b1e21; } -.close { +.close, .btn-close { float: right; font-size: 1.40625rem; font-weight: 700; @@ -18564,25 +18564,25 @@ a.badge-dark:focus, a.badge-dark.focus { opacity: 0.5; } @media (max-width: 1200px) { - .close { + .close, .btn-close { font-size: calc(0.950625rem + 0.6075vw); } } -.close:hover { +.close:hover, .btn-close:hover { color: #000; text-decoration: none; } -.close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus { +.close:not(:disabled):not(.disabled):hover, .btn-close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus, .btn-close:not(:disabled):not(.disabled):focus { opacity: 0.75; } -button.close { +button.close, button.btn-close { padding: 0; background-color: transparent; border: 0; } -a.close.disabled { +a.close.disabled, a.disabled.btn-close { pointer-events: none; } @@ -18747,7 +18747,7 @@ a.close.disabled { border-top-left-radius: calc(0.3rem - 1px); border-top-right-radius: calc(0.3rem - 1px); } -.modal-header .close { +.modal-header .close, .modal-header .btn-close { padding: 1rem 1rem; margin: -1rem -1rem -1rem auto; } @@ -23147,8 +23147,8 @@ a.dropdown-toggle.focus, a.dropdown-toggle:focus, .moodle-dialogue-base .closebutton.focus, .moodle-dialogue-base .closebutton:focus, -button.close.focus, -button.close:focus, +button.btn-close.focus, +button.btn-close:focus, .form-autocomplete-selection.focus, .form-autocomplete-selection:focus, [role=treeitem]:not([aria-expanded=true]).focus, @@ -23170,7 +23170,7 @@ input[type=image]:focus:hover, .sr-only-focusable:focus:hover, a.dropdown-toggle:focus:hover, .moodle-dialogue-base .closebutton:focus:hover, -button.close:focus:hover, +button.btn-close:focus:hover, .form-autocomplete-selection:focus:hover, [role=treeitem]:not([aria-expanded=true]):focus:hover { text-decoration: none; @@ -25581,7 +25581,7 @@ input[disabled] { .alert-primary a { color: #041d34; } -.alert-primary .close { +.alert-primary .btn-close { color: #000305; opacity: 0.6; } @@ -25589,7 +25589,7 @@ input[disabled] { .alert-secondary a { color: #525557; } -.alert-secondary .close { +.alert-secondary .btn-close { color: #393b3d; opacity: 0.6; } @@ -25597,7 +25597,7 @@ input[disabled] { .alert-success a, .environmenttable .ok a { color: #0c1b0b; } -.alert-success .close, .environmenttable .ok .close { +.alert-success .btn-close, .environmenttable .ok .btn-close { color: black; opacity: 0.6; } @@ -25605,7 +25605,7 @@ input[disabled] { .alert-info a { color: #00171b; } -.alert-info .close { +.alert-info .btn-close { color: black; opacity: 0.6; } @@ -25613,7 +25613,7 @@ input[disabled] { .alert-warning a, .environmenttable .warn a { color: #573e1c; } -.alert-warning .close, .environmenttable .warn .close { +.alert-warning .btn-close, .environmenttable .warn .btn-close { color: #302310; opacity: 0.6; } @@ -25621,7 +25621,7 @@ input[disabled] { .alert-danger a, .environmenttable .error a { color: #3d0f0a; } -.alert-danger .close, .environmenttable .error .close { +.alert-danger .btn-close, .environmenttable .error .btn-close { color: #110403; opacity: 0.6; } @@ -25629,7 +25629,7 @@ input[disabled] { .alert-light a { color: #686868; } -.alert-light .close { +.alert-light .btn-close { color: #4e4e4f; opacity: 0.6; } @@ -25637,7 +25637,7 @@ input[disabled] { .alert-dark a { color: #040505; } -.alert-dark .close { +.alert-dark .btn-close { color: black; opacity: 0.6; } @@ -32895,6 +32895,9 @@ body.path-question-type .mform fieldset.hidden { } .simplesearchform .btn-close { right: 2.2rem; + opacity: inherit; + font-size: inherit; + line-height: inherit; } .simplesearchform .btn-submit { background-color: #f8f9fa; @@ -36943,10 +36946,10 @@ span[data-flexitour=container][x-placement=right] div[data-role=arrow]:after, sp left: 50%; transform: translate(-50%, -50%); } -.modal .close { +.modal .btn-close { margin: -0.8rem -0.8rem -0.8rem auto; } -.modal .close:not(:disabled):not(.disabled):hover, .modal .close:not(:disabled):not(.disabled):focus { +.modal .btn-close:not(:disabled):not(.disabled):hover, .modal .btn-close:not(:disabled):not(.disabled):focus { opacity: inherit; } @@ -37697,7 +37700,7 @@ div.editor_atto_toolbar button .icon { margin: 2px 5px 0 0; content: "\f06a"; } -.toast .close { +.toast .btn-close { color: inherit; }