From ed0ea193a97380dfdf494e3738e9a05a04618105 Mon Sep 17 00:00:00 2001 From: Dimitris Grammatikogiannis Date: Sun, 7 Dec 2025 10:23:50 +0200 Subject: [PATCH 1/3] Fix tiny dark mode --- build/media_source/plg_editors_tinymce/js/tinymce.es6.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js index 86c8b0a73f0bb..259b34a928ef8 100644 --- a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js +++ b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js @@ -165,10 +165,14 @@ Joomla.JoomlaTinyMCE = { if ('colorSchemeOs' in document.documentElement.dataset) { const mql = window.matchMedia('(prefers-color-scheme: dark)'); options.skin = mql.matches ? skinDark : skinLight; - options.content_css = mql.matches ? 'dark' : 'default'; + if (ql.matches) { + options.content_css = options.content_css ? `${options.content_css}, dark` : 'dark'; + } else { + options.content_css = options.content_css ? `${options.content_css}, default` : 'default'; + } } else if (document.documentElement.dataset.colorScheme === 'dark') { options.skin = skinDark; - options.content_css = 'dark'; + options.content_css = options.content_css ? `${options.content_css}, dark` : 'dark'; } // Ensure tinymce is initialised in readonly mode if the textarea has readonly applied From 1d38f523e64edd153f64ac261b083a03f84fcd02 Mon Sep 17 00:00:00 2001 From: Dimitris Grammatikogiannis Date: Sun, 7 Dec 2025 10:29:48 +0200 Subject: [PATCH 2/3] Fix variable name from 'ql' to 'mql' in color scheme --- build/media_source/plg_editors_tinymce/js/tinymce.es6.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js index 259b34a928ef8..539801e16598c 100644 --- a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js +++ b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js @@ -165,7 +165,7 @@ Joomla.JoomlaTinyMCE = { if ('colorSchemeOs' in document.documentElement.dataset) { const mql = window.matchMedia('(prefers-color-scheme: dark)'); options.skin = mql.matches ? skinDark : skinLight; - if (ql.matches) { + if (mql.matches) { options.content_css = options.content_css ? `${options.content_css}, dark` : 'dark'; } else { options.content_css = options.content_css ? `${options.content_css}, default` : 'default'; From 0deee95aeb953db7a46d8a965495a008c004fa70 Mon Sep 17 00:00:00 2001 From: Dimitris Grammatikogiannis Date: Sun, 7 Dec 2025 10:49:20 +0200 Subject: [PATCH 3/3] Simplify content_css handling for dark mode Refactor content_css assignment for dark mode. --- build/media_source/plg_editors_tinymce/js/tinymce.es6.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js index 539801e16598c..c3faa28203bcc 100644 --- a/build/media_source/plg_editors_tinymce/js/tinymce.es6.js +++ b/build/media_source/plg_editors_tinymce/js/tinymce.es6.js @@ -166,13 +166,11 @@ Joomla.JoomlaTinyMCE = { const mql = window.matchMedia('(prefers-color-scheme: dark)'); options.skin = mql.matches ? skinDark : skinLight; if (mql.matches) { - options.content_css = options.content_css ? `${options.content_css}, dark` : 'dark'; - } else { - options.content_css = options.content_css ? `${options.content_css}, default` : 'default'; + options.content_css = options.content_css ? `${options.content_css},dark` : 'dark'; } } else if (document.documentElement.dataset.colorScheme === 'dark') { options.skin = skinDark; - options.content_css = options.content_css ? `${options.content_css}, dark` : 'dark'; + options.content_css = options.content_css ? `${options.content_css},dark` : 'dark'; } // Ensure tinymce is initialised in readonly mode if the textarea has readonly applied