Skip to content

Commit

Permalink
Toggle TinyMCE dark mode and skin based on the set tabler theme (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
dheineman committed Sep 11, 2022
1 parent 68b12c5 commit ffde2b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pages/_includes/ui/tinymce.html
Expand Up @@ -8,7 +8,7 @@
<script>
// @formatter:off
document.addEventListener("DOMContentLoaded", function () {
tinyMCE.init({
let options = {
selector: '#tinymce-{{ id }}',
height: 300,
menubar: false,
Expand All @@ -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>
Expand Down

0 comments on commit ffde2b5

Please sign in to comment.