Problem/Motivation

Current CKEditor stylsheet is bleeding because:

ckeditor5-stylesheets:
  - /libraries/dsfr/dist/core/core.css
  - /libraries/dsfr/dist/utility/icons/icons.css

It's needed for proper display of DSFR icons in CKEditor.

Steps to reproduce

Open a node with body and icons plugin.

Proposed resolution

Have this css created dynamically from a route, or create a manual css copy.

Related to #3535140: CKEditor dsfr css bleeding

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Assigned: Unassigned » mogtofu33

grimreaper made their first commit to this issue’s fork.

grimreaper’s picture

Version: 1.1.x-dev » 1.x-dev

grimreaper’s picture

Status: Active » Needs work

Hi,

I have created a quick and dirty workaround to avoid problem on existing websites if they want. I copied the CSS from app/libraries/dsfr/dist/core/core.css impacting icons.

I agree that a dedicated dynamic to be generated is a good solution. But as ui_suite_dsfr is a theme it can't provide controller and route.

I think, we can create a new route in UI Styles like ui_styles.stylesheet but in the extraction logic, instead of filtering regarding the styles plugin, it could take as parameters:

- prefix (like existing route)
- library (list of libraries or string if targeting just one)

And so it would just generate from the CSS of this library.

grimreaper’s picture

Hum, thinking out loud.

But if this new route has nothing to do with styles plugin, why put it in ui_styles?

Should this logic be extracted into a dedicated module?

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Needs review

Wrapped the css in .ck-content and added pictogram and icons colors.

For sure this kind of route seems strange in ui_styles, and dynamic prefix would be huge as dsfr is huge (The PHP process to wrap is heavy)
I tried a packed solution with prefix to include (with gulp for example), but there is some co lateral problems.

The current dirty fix seems enough for me.

just_like_good_vibes’s picture

Assigned: Unassigned » just_like_good_vibes
Status: Needs review » Reviewed & tested by the community

ok let's merge that

just_like_good_vibes’s picture

Title: CKEditor css bleeding » [1.14.3] CKEditor css bleeding

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.