From 91171a2a474093493ac6bb4749cc0ee5c40a7a0d Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Sun, 28 Jul 2024 20:10:44 -0500 Subject: [PATCH 1/2] Internal: Add CSS reset for TinyMCE editor content - refs BT#21876 --- assets/css/app.scss | 1 + assets/css/editor_content.css | 27 ++++++++ .../basecomponents/BaseTinyEditor.vue | 61 +++++++++---------- 3 files changed, 58 insertions(+), 31 deletions(-) diff --git a/assets/css/app.scss b/assets/css/app.scss index 892ba4f1c5c..920fd89a9ef 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -9,6 +9,7 @@ //@import '~jquery-ui/themes/base/all.css'; @import "tinymce/skins/ui/oxide/skin.css"; +@import './editor_content.css'; @layer utilities { .border-gray-300 { diff --git a/assets/css/editor_content.css b/assets/css/editor_content.css index f47fecf813a..11ec54d5348 100644 --- a/assets/css/editor_content.css +++ b/assets/css/editor_content.css @@ -2,6 +2,33 @@ Stylesheet for HTML blocks created with CKEditor to embed in Chamilo pages. */ +/* Reset styles */ +.tiny-content { + all: initial; + display: block; + width: 100%; +} + +.tiny-content * { + all: revert; + box-sizing: border-box; +} + +/* Specific styles for TinyMCE content */ +.tiny-content img { + display: block !important; + margin-left: auto !important; + margin-right: auto !important; + width: auto !important; + height: auto !important; +} + +.tiny-content table { + margin: auto !important; + width: auto !important; +} + + /* Hack for show Bootstrap alerts in CKEditor' style select */ .cke_panel_listItem a > :first-child { margin-bottom: 0; diff --git a/assets/vue/components/basecomponents/BaseTinyEditor.vue b/assets/vue/components/basecomponents/BaseTinyEditor.vue index 73acc43665e..4c3a331425f 100644 --- a/assets/vue/components/basecomponents/BaseTinyEditor.vue +++ b/assets/vue/components/basecomponents/BaseTinyEditor.vue @@ -21,7 +21,7 @@