From cdd4fb844ed938cfdcd637c9d0b8135f38c3b822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Thu, 3 Jul 2025 14:59:00 +0200 Subject: [PATCH] MDL-85659 theme_boost: Fix editor generated tables styles --- theme/boost/scss/editor.scss | 17 +++++++++++++++++ theme/boost/scss/moodle/undo.scss | 17 +++++++++++++++++ theme/boost/style/moodle.css | 15 +++++++++++++++ theme/classic/style/moodle.css | 15 +++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/theme/boost/scss/editor.scss b/theme/boost/scss/editor.scss index 74eb7794000..b5a870aeb93 100644 --- a/theme/boost/scss/editor.scss +++ b/theme/boost/scss/editor.scss @@ -1,2 +1,19 @@ /* Give editor access to all of bootstrap. */ @import "bootstrap/bootstrap"; + +/** + * Reset the Bootstrap _reboot.scss styles for tables. + * That reboot is breaking non-BS tables in the editor. + */ +table:not(.table) { + thead, + tbody, + tfoot, + tr, + td, + th { + border-color: $table-border-color; + border-style: solid; + border-width: $table-border-width; + } +} diff --git a/theme/boost/scss/moodle/undo.scss b/theme/boost/scss/moodle/undo.scss index e7ff664e546..b7ad833ea59 100644 --- a/theme/boost/scss/moodle/undo.scss +++ b/theme/boost/scss/moodle/undo.scss @@ -238,3 +238,20 @@ $allow-reset-style: true !default; } } } + +/** + * Reset the Bootstrap _reboot.scss styles for tables. + * That reboot mainly affects tables added by the tiny editor. + */ +table:not(.table) { + thead, + tbody, + tfoot, + tr, + td, + th { + border-color: $table-border-color; + border-style: solid; + border-width: $table-border-width; + } +} diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 807758bb28b..c307fcacf62 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -38292,6 +38292,21 @@ body.reset-style .btn:not(.btn-icon) { border-radius: 0.6rem; } +/** + * Reset the Bootstrap _reboot.scss styles for tables. + * That reboot mainly affects tables added by the tiny editor. + */ +table:not(.table) thead, +table:not(.table) tbody, +table:not(.table) tfoot, +table:not(.table) tr, +table:not(.table) td, +table:not(.table) th { + border-color: var(--bs-border-color); + border-style: solid; + border-width: var(--bs-border-width); +} + body.behat-site .fixed-top { position: absolute; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 152f265d3ff..069bb70e5bd 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -38226,6 +38226,21 @@ body:not(.jsenabled) .langmenu:hover > .dropdown-menu, * - Make the content region flex grow so it pushes things like the * next activity selector to the bottom of the page. */ +/** + * Reset the Bootstrap _reboot.scss styles for tables. + * That reboot mainly affects tables added by the tiny editor. + */ +table:not(.table) thead, +table:not(.table) tbody, +table:not(.table) tfoot, +table:not(.table) tr, +table:not(.table) td, +table:not(.table) th { + border-color: var(--bs-border-color); + border-style: solid; + border-width: var(--bs-border-width); +} + body.behat-site .fixed-top { position: absolute; }