Is it possible to define generic block level styles in CKeditor5, instead of targeting a specific HTML tag?
E.g. I can define this in editor.full_html.twig
settings:
plugins:
ckeditor5_style:
styles:
-
label: 'looks like header 1'
element: '<p class="h1">'
-
label: 'looks like header 2'
element: '<p class="h2">'
But with this setting an editor can not style e.g. an <h3>
to look like an .h2
Now I could add every single combination as style
settings:
plugins:
ckeditor5_style:
styles:
-
label: 'P looks like header 1'
element: '<p class="h1">'
-
label: 'H2 looks like header 1'
element: '<h2 class="h1">'
-
label: 'H3 looks like header 1'
element: '<h3 class="h1">'
-
label: 'H4 looks like header 1'
element: '<h4 class="h1">'
-
label: '...(exaggerated example 300 lines later) H1 looks like header 6...'
element: '<h1 class="h6">'
and I could live with the massive YAML config, but the styles combo in the admin UI gets equally polluted and flooded with so many disabled options that it becomes unusable.
Is there a way to define a style as "generic block level style"? E.g. a style .h1
that can be applied to any block tags like <p>
and <h2>
and <h3>
and <h4>
etc?
In CK4 a p.h4
was also available/mouse-clickable when the cursor was inside a <h3>
. I don't know to to migrate that.