CKEditor code element missing styles

Task type
Project
Topics
Modules
Changed

Context

There are styles in ckeditor, but not when displayed.

Theme docs

https://contrib.drupalarchitect.info/project/drupal-architect/task/179-…

Questions

How to use the same styles?

Issues

View on Drupal.org #3267443 [PP-1] Add starterkit ckeditor5-stylesheets config Status: Active

View on Drupal.org #3458077 Allow overriding/disabling base theme's ckeditor5-stylesheets value Status: Needs work

View on Drupal.org #3449576 Ckeditor Style plugin forces span definition element giving side effects Status: Active

View on Drupal.org #3410100 [10.2 regression] CKEditor 5 breaks when "Source"/Source editing button is added and "Manually editable HTML tags" are specified Status: Needs work

View on Drupal.org #3415178 [10.2 regression] CKEditor 5 prevents Styles from adding span as allowed HTML Status: Needs work

Findings

These inline styles are from ckeditor.

.ck-content code {
 background-color:hsla(0,0%,78%,.3);
 border-radius:2px;
 padding:.15em
}
.ck.ck-editor__editable .ck-code_selected {
 background-color:hsla(0,0%,78%,.5)
}

Override by prefixing with .ck.

Resolution

Fixed background color utility and copied to ckeditor stylesheet.

Using:

core/ckeditor5:
  - mantra_starter/ckeditor