plone / plonetheme.barceloneta

The default theme for Plone Classic UI
https://pypi.python.org/pypi/plonetheme.barceloneta
19 stars 41 forks source link

Tinymce UI css updates #345

Open petschki opened 1 year ago

petschki commented 1 year ago

TinyMCE <iframe/> implementation has missing CSS definitions of plone content. For example if you align an image on the right you see it in the view mode but not when editing it in TinyMCE. This PR extends the tinymce-ui-content.css with the barceloneta/base CSS via SCSS.

mister-roboto commented 1 year ago

@petschki thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

petschki commented 1 year ago

@jenkins-plone-org please run jobs

petschki commented 11 months ago

Had time to dig more into this. Turns out, that the internal content_css configuration logic is based on three parameters concated together (see https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/patterns/tinymce.py#L34):

So theres a problem here, because if you use a Diazo based theme with tinymce-content-css configured (default in plonetheme.barceloneta an with bobtemplates.plone created themes), you end up with unneeded duplicated CSS code in TinyMCE.

OTOH if your theme doesn't configure the CSS in metadata.cfg, you have unstyled content in TinyMCE right now.

Do not know how to proceed here, but I mark this as draft right now.

/cc @MrTango

petschki commented 11 months ago

@gogobd @jensens maybe interesting for you too ⬆️

petschki commented 11 months ago

Thinking more about this we could say that it's more a documentation problem. Tell the integrators how to get their styles into tiny either with configured tinymce-content-css or with customized ITinyMCESchema.content_css registry value.