ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Next.js installation snippets result in white-on-white text if using system-wide dark mode

Open lkszzajac opened this issue 1 year ago • 6 comments

📝 Provide a description of requested docs changes

What is the purpose and what should be changed?

Current Next.js installation instruction might result in the white text on a white background if the user is using system-wide dark mode and the project is set up with create-next-app and snippets from https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/getting-started/installation/next-js.html

It results from default global CSS rules in globals.css generated when creating a next.js project, specifically - foreground-rgb: 255, 255, 255 in globals.css:45.

It is mentioned in the docs at the end of the guide that this could happen, but it’s easy to be overlooked. We could consider adding some dedicated styling to the snippets so they will work in the dark mode by default.

lkszzajac avatar Jun 11 '24 07:06 lkszzajac

Dark mode is a hard topic for us, and unfortunately it's not the solution we could quickly apply here. We would need to fix it on the docs level.

Witoso avatar Jun 11 '24 07:06 Witoso

I'm more and more inclined into adding some very basic font styles into the editor styles.

This is, in fact, necessary anyway if we were to also ship a dark theme. So we may need to do it anyway.

Reinmar avatar Jun 11 '24 14:06 Reinmar

This would need to be marked as major BC, but most likely obvious for integrators to "migrate to".

Reinmar avatar Jun 11 '24 14:06 Reinmar

I'm hesitant about adding major BCs to v42, to decrease the splash zone and the feeling "Oh, they do something major and something broke on my side". We have no majors right now, and I'm happy about it. TBD.

Witoso avatar Jun 11 '24 14:06 Witoso

Potential solution: more specific background selector (now white) that only applies to light themes?

Witoso avatar Jun 12 '24 09:06 Witoso

Note: As long as we don't have a ready-to-use dark theme for CKE5, the interface of CKE5 will be light even though the page in which it's embedded may be running a dark theme.

Therefore, the default style of text in the editor content should be aligned to the style of the editor interface: light background and dark text.

Reinmar avatar Jun 13 '24 10:06 Reinmar

Hi everyone, I spent a lot of time searching for dark and light mode props or any other solutions for CKEditor, but I couldn't find a proper answer. So, I came up with an alternative way to fix this issue in my Next.js project. You can check out the solution here. I’m sharing this to save other developers time and effort!

Mudassarali222 avatar Sep 19 '24 04:09 Mudassarali222

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Sep 19 '25 23:09 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Oct 20 '25 23:10 CKEditorBot