Insert the editor stylesheet as the first style
authorAlexander Ebert <ebert@woltlab.com>
Sat, 26 Aug 2023 18:37:58 +0000 (20:37 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 26 Aug 2023 18:37:58 +0000 (20:37 +0200)
This change allows overruling the editor’s CSS using the same selectors.

com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/acp/templates/wysiwyg.tpl

index 225e1c0b2b34dee39a1e8310e92ef2e4aa55b044..c5783014ba23ab80c63e1cb27d4a554e3eadf662 100644 (file)
@@ -12,7 +12,7 @@
                stylesheet.href = "{$__wcf->getPath()}style/ckeditor5.css";
                stylesheet.id = "ckeditor5-stylesheet";
 
-               document.head.append(stylesheet);
+               document.querySelector('link[rel="stylesheet"]').before(stylesheet);
        }
 }
 </script>
index 225e1c0b2b34dee39a1e8310e92ef2e4aa55b044..c5783014ba23ab80c63e1cb27d4a554e3eadf662 100644 (file)
@@ -12,7 +12,7 @@
                stylesheet.href = "{$__wcf->getPath()}style/ckeditor5.css";
                stylesheet.id = "ckeditor5-stylesheet";
 
-               document.head.append(stylesheet);
+               document.querySelector('link[rel="stylesheet"]').before(stylesheet);
        }
 }
 </script>