Allow adding custom CSS to editor context menu #2202
Labels
changelog:api
A changelog entry should be put in the API section of the changelog.
status:confirmed
An issue confirmed by the development team.
support
An issue reported by a commercially licensed client.
target:major
Any docs related issue that should be merged into a major branch.
type:feature
A feature request.
Milestone
Type of report
Feature request
Provide description of the new feature
Contents of editor menus, including context menu are being displayed inside an iframe. For context menu only
editor.css
file is being attached.Two approaches can be used here:
contents.css
to context menu iframe just like it is being done for dropdowns.From what I have checked, the whole logic works in the following way:
Everything starts with panel prototype using CSS:
https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/panel/plugin.js#L114-L117
That CSS gets inserted into array which later gest inserted into iframe:
https://github.com/ckeditor/ckeditor-dev/blob/major/core/tools.js#L346-L360
https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/panel/plugin.js#L75-L80
https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/panel/plugin.js#L114-L117
Context menu plugin is based on general Menu plugin which uses panel mentioned in point 1 to specify its own CSS:
https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/menu/plugin.js#L163
for which path is calculated based on getCssPath method:
https://github.com/ckeditor/ckeditor-dev/blob/major/core/skin.js#L137-L163
It seems to me that the best place for inserting new CSS would be here:
https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/menu/plugin.js#L163
We could create a new configuration setting which would get read there.
The text was updated successfully, but these errors were encountered: