1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-26 19:26:10 +04:00

Toggle TinyMCE dark mode and skin based on the set tabler theme (#1241)

This commit is contained in:
Dave Heineman
2022-09-11 16:00:57 +02:00
committed by GitHub
parent 68b12c5e1b
commit ffde2b5bae

View File

@@ -8,7 +8,7 @@
<script>
// @formatter:off
document.addEventListener("DOMContentLoaded", function () {
tinyMCE.init({
let options = {
selector: '#tinymce-{{ id }}',
height: 300,
menubar: false,
@@ -23,7 +23,14 @@
'alignright alignjustify | bullist numlist outdent indent | ' +
'removeformat',
content_style: 'body { font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }'
});
}
if (localStorage.getItem("tablerTheme") === 'dark') {
options.skin = 'oxide-dark';
options.content_css = 'dark';
}
tinyMCE.init(options);
})
// @formatter:on
</script>