Problem/Motivation
The icon is not visible when added via the ckeditor plugin. The icon is white on white.
My OS is in dark mode, my admin theme is not.
![]()
Proposed resolution
It would be nice if the icon uses the color of the text, aka currentcolor.
Currently the icon contains the fill="currentColor" in de svg code itself. This does not work when the svg is used via background-image is css.
Converting to mask-image makes it possible the use the currentcolor in combination with setting a background-color.
![]()
JS
In: iconify_field/modules/iconify_field_ckeditor/js/build/IconifyFieldPlugin.js
Change background-image to mask-image on line 208
CSS
In the css file: iconify_field/modules/iconify_field_ckeditor/css/iconify_field_ckeditor.css
Replace:
.ck-editor__main .iconify-field {
background-position: center;
background-size: contain;
background-repeat: no-repeat;
....
With:
.ck-editor__main .iconify-field {
background-color: currentcolor;
mask-position: center;
mask-repeat: no-repeat;
mask-size: contain;
....
Extra
If feel setting the vertical-align value to `-0.125em` gives a nicer alignment then the current `middle' value.
| Comment | File | Size | Author |
|---|---|---|---|
| iconify-field--editor--icon.png | 8.44 KB | strnbrg | |
| iconify-field--editor--no-icon.png | 9.22 KB | strnbrg |
Comments
Comment #2
dobefu commentedAh, that is something that I haven't yet tested properly. I will look into this after supper
Comment #3
dobefu commentedI do like the solution with the image mask, but it does break the selection outline of the elements in the CKEditor. I'll try a slightly different approach to solve both issues
Comment #4
dobefu commentedI've fixed the issue in https://git.drupalcode.org/project/iconify_field/-/merge_requests/9. I'll create a new release at the end of this weekend.
Comment #5
dobefu commentedComment #6
dobefu commented