Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I also added the ckeditor5-stylesheets: to the info.yml of the core Olivero theme and set that as default. This was an attempt to see if I had messed up something with my customized theme, but still no joy.
On the page where you're expecting css/custom/google-reviews-hero.css to be loaded, can you please evaluate drupalSettings.ajaxPageState.theme in the console? What value does that return?
I am running into a similar issue on 9.5.11. I am getting my admin theme's CSS in CKE, which I do not want, and it seems that the intended way to disable this is to add the following to your admin theme's info.yml file:
ckeditor5-stylesheets: false
This does not work for me. When I go into ckeditor5.module and debug _ckeditor5_theme_css() to figure out why this is happening, it looks like the 'stable' theme is being injected into the $info variable, which per the code should only happen if the $theme variable is not set. I am not finding any documentation about this, but there should definitely be away to easily disable admin theme CSS within the editor
Edit: It looks like 'stable' was appearing because that was somehow set as the base theme for my front-end theme. that being said, if I change that to false, I'm now getting CSS from my admin theme, which I have also set to not inject into CKE, but this is being ignored and the theme's CSS is being added anyway. If I inspect the $css variable at the bottom of_ckeditor5_theme_css(), it only shows my front-end theme, yet ckeditor is still using the admin theme. Perhaps this makes sense since the editor is being rendered on an admin page and not in an iframe, but surely there must be a way to disable this other than specifically telling your admin theme to exclude each and every single style from CKE divs?
I'd say the implementation of ckeditor5-related stylesheets is a major issue right now. On top of not working at all for some people, we are also dealing with admin theme styles leaking into the editor when they are unwanted, as well as front-end theme styles leaking onto the admin pages when we only want them in the editor. If this is a natural consequence of doing away with iframes, is there a way to solve these issues so this all works the way it did before ckeditor5? If not, that is a major problem.
This change record was helpful in getting the in-editor themes mostly worked out, particularly the second row in the table, but requires some trial and error, depending on your theme and design system. This has allowed me to work out most of my issues with getting the front-end styles into the editor. The key for me was creating a separate scss file for ckeditor and telling my gulpfile that I now have two main sources. I don't love that this seems to effectively double to size of my CSS assets, but in theory only one set is loaded at a time if you are using a separate admin theme.
The problem still remains that some admin theme styles still appear within the editor. I've found that across themes, button styles are the most problematic, as they always seem to override my front-end styles. This can be worked around by overriding some button CSS in your front-end theme, and this may work for other elements as well. I still think it's problematic that this is necessary in the first place, but I'm not sure what the solution to that particular problem is.
2. You may already know this, just in case you don't: one way to prevent admin theme's CSS in CKEditor5 is to turn off the "Use the administration theme when editing or creating content" option in /admin/appearance. But this doesn't help for when the admin theme is preferred in the edit pages.
Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.
Comments
Comment #2
stevieegee commentedComment #3
cilefen commentedPlease show us your code.
Comment #4
stevieegee commentedComment #5
stevieegee commentedI followed these docs https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...
Comment #6
stevieegee commentedI also added the ckeditor5-stylesheets: to the info.yml of the core Olivero theme and set that as default. This was an attempt to see if I had messed up something with my customized theme, but still no joy.
Comment #7
wim leersOn the page where you're expecting
css/custom/google-reviews-hero.cssto be loaded, can you please evaluatedrupalSettings.ajaxPageState.themein the console? What value does that return?Comment #8
stevieegee commented"theme": "gin",
Below is the drupalSettings.ajaxPageState output.
Comment #9
RSNoon commentedHaving the same issue here, using Claro for the administration theme, with a custom front-end theme:
Custom theme info.yml:
Output of
drupalSettings.ajaxPageState.themewhen trying to add or edit a piece of content:Output of
drupalSettings.ajaxPageStateon the same page:Comment #10
anzi31 commentedAre there any updates on this issue?
I am having the same problem.
Comment #11
chrisgross commentedI am running into a similar issue on 9.5.11. I am getting my admin theme's CSS in CKE, which I do not want, and it seems that the intended way to disable this is to add the following to your admin theme's info.yml file:
ckeditor5-stylesheets: falseThis does not work for me. When I go into ckeditor5.module and debug _ckeditor5_theme_css() to figure out why this is happening, it looks like the 'stable' theme is being injected into the $info variable, which per the code should only happen if the $theme variable is not set. I am not finding any documentation about this, but there should definitely be away to easily disable admin theme CSS within the editor
Edit: It looks like 'stable' was appearing because that was somehow set as the base theme for my front-end theme. that being said, if I change that to false, I'm now getting CSS from my admin theme, which I have also set to not inject into CKE, but this is being ignored and the theme's CSS is being added anyway. If I inspect the $css variable at the bottom of_ckeditor5_theme_css(), it only shows my front-end theme, yet ckeditor is still using the admin theme. Perhaps this makes sense since the editor is being rendered on an admin page and not in an iframe, but surely there must be a way to disable this other than specifically telling your admin theme to exclude each and every single style from CKE divs?
Comment #12
chrisgross commentedComment #13
hitesh.koliI am having the same issue using Claro as base theme for the administration with a custom theme.
Comment #14
johnpitcairn commentedComment #15
chrisgross commentedI'd say the implementation of ckeditor5-related stylesheets is a major issue right now. On top of not working at all for some people, we are also dealing with admin theme styles leaking into the editor when they are unwanted, as well as front-end theme styles leaking onto the admin pages when we only want them in the editor. If this is a natural consequence of doing away with iframes, is there a way to solve these issues so this all works the way it did before ckeditor5? If not, that is a major problem.
Comment #16
chrisgross commentedAlso, the version was recently changed to 11.x, but this seems to be affecting 9 and 10 as well, basically anything using ckeditor5.
Comment #17
johnpitcairn commentedYup but any fix will be against 11.x then backported, right?
I've definitely noticed Claro blockquote styling leaks into the editor. Annoying.
Comment #18
flodevelop commentedHello,
It is possible to load the css with a hook :
Comment #19
chrisgross commentedThis change record was helpful in getting the in-editor themes mostly worked out, particularly the second row in the table, but requires some trial and error, depending on your theme and design system. This has allowed me to work out most of my issues with getting the front-end styles into the editor. The key for me was creating a separate scss file for ckeditor and telling my gulpfile that I now have two main sources. I don't love that this seems to effectively double to size of my CSS assets, but in theory only one set is loaded at a time if you are using a separate admin theme.
The problem still remains that some admin theme styles still appear within the editor. I've found that across themes, button styles are the most problematic, as they always seem to override my front-end styles. This can be worked around by overriding some button CSS in your front-end theme, and this may work for other elements as well. I still think it's problematic that this is necessary in the first place, but I'm not sure what the solution to that particular problem is.
Comment #20
ravi kant commentedI am using
libraries-extendand it is working for me.Comment #21
druplr commented@chrisgross
1. Did you manage to disable base theme's
ckeditor5-stylesheetsthrough sub-theme's.info.ymlfile? I just created an issue for that: Allow overriding/disabling base theme's ckeditor5-stylesheets value which also includes a workaround.2. You may already know this, just in case you don't: one way to prevent admin theme's CSS in CKEditor5 is to turn off the "Use the administration theme when editing or creating content" option in
/admin/appearance. But this doesn't help for when the admin theme is preferred in the edit pages.Comment #22
jglynn commentedI also have this problem.