#111383Render CKEditor 5 inside a shadow DOM
Description
The <typo3-rte-ckeditor-ckeditor5> element currently renders CKEditor 5 into the light DOM. Editor styles are therefore global and leak into the backend (they are partly shipped via backend.css), and custom contentsCss needs to be prefixed with the id of the field and an additional fullscreen selector to be scoped to a single editor instance.</typo3-rte-ckeditor-ckeditor5>
CKEditor 5 v49 (see #111382) supports rendering the editor inside a shadow root, as requested on https://github.com/ckeditor/ckeditor5/issues/3891#issuecomment-5666492906
The editor should be attached to the shadow root of <typo3-rte-ckeditor-ckeditor5>:</typo3-rte-ckeditor-ckeditor5>
- editor UI styles move into the editor stylesheet, which is loaded inside the shadow root, and are removed from backend.css
- contentsCss is adopted by the shadow root and only needs the .ck-content prefix
- the fullscreen mode uses a container inside the shadow root
- balloons and popups need an overlay container (ui.overlayContainer) in order to be positioned correctly
Open points:
- The overlay container lives in a separate shadow root, so the editor stylesheet has to be loaded twice. Check if this can be avoided.
- Check that all TYPO3 specific stylings still apply inside the shadow DOM, e.g. the placeholder mode (useOrOverridePlaceholder).
Reviews 1
History 02
-
Gerrit Code Review pushed patch set 5 for main to change 96032 status
In ProgressUnder Review <span data-processor="relativetime" data-value="2026-11-09T14:57:45+00:00" > 11/09/26, 14:57 </span> -
Gerrit Code Review pushed patch set 6 for main to change 96032 <span data-processor="relativetime" data-value="2026-11-09T15:28:34+00:00" > 11/09/26, 15:28 </span>