Problem/Motivation

When fill="black" is set on the SVG it will break darkmode in Gin. Let's remove it as it will fallback anyway to black if it is not set on the path.

Steps to reproduce

Check out a CKEditor 5 instance with Gin and Darkmode enabled.

Proposed resolution

Remove fill="black" from SVG paths.

Before After

Remaining tasks

Remove fill="black" from SVG paths.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3314541

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

saschaeggi created an issue. See original summary.

saschaeggi’s picture

Issue tags: +darkmode

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

enaznin’s picture

StatusFileSize
new41.78 KB

Hi,
Ckeditor section is white for me. Turned on the media library and Gin themes dark mode. am I missing something?

saschaeggi’s picture

Title: Remove fill from drupal media button » Remove fill from drupal media button svg
Related issues: +#3255204: [SUPPORT] CKEditor5

@eashika great call, I forgot to mention that you'll need the changes from #3255204: [SUPPORT] CKEditor5

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

wim leers’s picture

Title: Remove fill from drupal media button svg » Remove fill from SVG icon for the "Media Library" CKEditor 5 button
Status: Active » Reviewed & tested by the community
Issue tags: +Contributed project blocker
Related issues: +#3231364: Add CKEditor 5 module to Drupal core, +#3198297: Toolbar UI for selecting and sorting buttons

#3231364: Add CKEditor 5 module to Drupal core introduced core/modules/ckeditor5/js/ckeditor5_plugins/drupalMedia/theme/icons/medialibrary.svg to core, but it was @zrpnr in https://git.drupalcode.org/project/ckeditor5/-/merge_requests/8/diffs?co... who added it to the CKEditor 5 contrib module in #3198297: Toolbar UI for selecting and sorting buttons.

It was never scrutinized since then.

AFAICT it originates from core/modules/ckeditor/js/plugins/drupalmedialibrary/icons/drupalmedialibrary.png.

I don't see any reason we would not do this, because it remains exactly the same visually before and after in Drupal core.

wim leers’s picture

Title: Remove fill from SVG icon for the "Media Library" CKEditor 5 button » Remove unnecessary fill from SVG icon for the "Media Library" CKEditor 5 button — enabling dark mode support in contrib
alexpott’s picture

Status: Reviewed & tested by the community » Needs work

@saschaeggi can you create a MR - there's no MR here to review or merge with core :)

wim leers’s picture

🙈🤣

/me just RTBC'd a non-existing patch based on screenshots 😇

saschaeggi’s picture

@alexpott @Wim Leers I'm not sure on which version this branch here was created but I wasn't able to add a new one. So maybe one of you can cherry-pick the change into a new branch.

Also can we backport this to 9.5.x, too?

wim leers’s picture

@saschaeggi Can you instead just upload the change as a patch? That's necessary to be able to test against multiple branches anyway. (Otherwise we'd have to open up four merge requests … 🙈)

(I don't know what went wrong in creating this merge request, but it's currently got a whopping 979 commits, which does not make sense.)

saschaeggi’s picture

Status: Needs work » Needs review
StatusFileSize
new2.61 KB

(I don't know what went wrong in creating this merge request, but it's currently got a whopping 979 commits, which does not make sense.)

Me either, there was already a branch so I guess it was created from an old code revision.

Anyway here is the patch 😊

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed that the SVG remains identical other than fill="none" being removed once and fill="black" being removed twice 👍

Also confirmed that this still results in an identical looking Media Library toolbar item compared to before in CKEditor 5's default look and feel 👍

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 14: 3314541-14.patch, failed testing. View results

saschaeggi’s picture

The error in the failed test does not seem to be related to this change

wim leers’s picture

Status: Needs work » Reviewed & tested by the community

That's a random failure. Re-testing.

alexpott’s picture

Version: 10.1.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Confirmed that the images are the same locally and I agree that the test fails have nothing to do with this issue.

Committed and pushed 78fb66dfd2 to 10.1.x and f2984b45d1 to 10.0.x and 2856c86add to 9.5.x and 53e06d90dd to 9.4.x. Thanks!

ckeditor5 is experimental in 9.4.x so backported all the way there.

  • alexpott committed 78fb66d on 10.1.x
    Issue #3314541 by saschaeggi, eashika, Wim Leers: Remove unnecessary...

  • alexpott committed f2984b4 on 10.0.x
    Issue #3314541 by saschaeggi, eashika, Wim Leers: Remove unnecessary...

  • alexpott committed 2856c86 on 9.5.x
    Issue #3314541 by saschaeggi, eashika, Wim Leers: Remove unnecessary...

  • alexpott committed 53e06d9 on 9.4.x
    Issue #3314541 by saschaeggi, eashika, Wim Leers: Remove unnecessary...
saschaeggi’s picture

Awesome thank you both! 😍

Status: Fixed » Closed (fixed)

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