CKEditor 5 - Toggle between dark and light theme/background for the editor on external action/event - ckeditor

I'm using CKEditor5 in a React app and trying to implement a toggle to switch between dark and light theme for CKEditor5.
From their documentation I came across this: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/ui/theme-customization.html
The documentation mainly describes styling the editor theme from scratch and building the ckeditor package which essentially defines the default style theme for the editor.
But what I'm trying to figure out is a way to manipulate the editor background and plugins color via. CSS on-the-fly based on event trigger (when user toggles the UI theme for the entire site via. toggle button) i.e. toggling between light and dark theme for the editor. Is there any way/pointers on how this can be done?
Right now, in my React component I invoke the CKEditor component in the following way to render it on the UI:
<div>
<CKEditor
editor={Editor}
config={editorConfiguration}
disabled={isReadOnlyMode}
data={fieldValue}
onReady={(editor) => {
if (isReadOnlyMode) {
const toolbarElement = editor.ui.view.toolbar.element;
toolbarElement.style.display = "none";
}
}}
/>
</div>

Related

Ck Editor custom CSS plugin

I tried for custom CKEditor CSS plugin for only gradient color,
Added js files and libraries too but in CKEditor button is displaying but not working

Laravel 9 + Jetstream - Tailwind Theme Background Color

I am having a difficult time changing the background color of the page. I have attempted Tailwind a few times in the past, but always reverted back to Bootstrap as I know it pretty well.
This is a fresh Laravel 9 with Jetstream installation. It comes with Tailwind v3 ready to go.
On the body tag in the guest layout, I tried bg-red and bg-red-900 classes. It's still grey. Tailwind does at least work, because I added bg-red-900 to the login button itself, and the button turned red. It's just not liking it on the body tag.
In tailwind.config.js I added:
module.exports = {
theme: {
backgroundColor: '#000000',
}
};
I also tried:
module.exports = {
theme: {
extend: {
backgroundColor: '#000000',
}
}
};
I run npm run dev and caching is disabled per Chrome dev tools settings. I even tried a hard reload (right click reload button with dev tools open and choose "Empty cache and hard reload").
I am sure the css is being generated as I can see the tailwind comments in css/app.css. The page works, as it shows the normal breeze login page as it should. It just refuses to change the background color. I get if I am setting it wrong in the config, but for it to not accept bg-something as a class seems weird.
How do I change the background color? It will be the same background color for every page, so like a theme, but I don't want to declare a whole theme palette.
This is probably something simple because I know nothing about Tailwind. I've just searched and dug through the docs and just don't get it.
The background color in Jetstream in the guest layout is actually coming from the authentication-card component.
Once you have published the Jetstream components the authentication-card.blade.php component can be located at:
resources/views/vendor/jetstream/components/authentication-card.blade.php
You should see a bg-gray-100 class in the root div tag which is what you need to change.

Change PESDK theme change to white

How to switch photoeditor react theme to white. Is there any configuration to change the theme OR need to customize the complete theme with assets.

smoothing in fonts in helix framework

i use helix for my website. but any font that I insert to it via #font-face not work correctly and text in the screen has some sharp region.
demo: link to site
note: texts in header and body have two different font.
I guess that this happen because of helix setting. Is it true?
please help me for create a website with smooth text
You have a native feature inside the template for assign multiple fonts to your website.
Go to Extensions > Templates > Your Helix Template > Tab Typography
From here you can add a different font for the body, headings, navigation or enable a custom font for css selectors. This feature works well with Google Fonts.
Here you can find more information: Typography Settings.

Joomla JCE editor removes <canvas> element on save

I use html 5 canvas with some javascript in joomla articles - JCE editor.
When I save the article, the editor removes the canvas element, only javascript remains.
I disabled all cleanup in jce:
Editor global configuration: validate html: no
Editor profiles -> Default -> Editor Parameters -> Cleanup & Output: Validate html: no
In Advanced options all is allowed (javascript, css, php, xhtml)
Joomla text filter: no filtering
and JCE stil removes this canvas line:
<canvas id="name" width="1170" height="400"></canvas>
I currently use Sourcerer plugin, but I don't like it because no code is highlighted.
Joomla 3.4, JCE 2.4.6
Try the following.
Go to
Extensions >> Plugin Manager >> TinyMCE >> Valid Elements
The add canvas to the textarea.

Resources