diff --git a/vendor-overwrites/colorpicker/colorpicker.css b/vendor-overwrites/colorpicker/colorpicker.css index 532a6a07..21dd4084 100644 --- a/vendor-overwrites/colorpicker/colorpicker.css +++ b/vendor-overwrites/colorpicker/colorpicker.css @@ -17,8 +17,12 @@ background-repeat: repeat; } -.cm-colorview + .cm-colorview.cm-overlay::before, -.cm-colorview.cm-overlay + .cm-colorview::before { +/* overlay at the start splits our colorview: don't style the tail */ +.cm-colorview.cm-overlay + .cm-colorview:not([data-colorpicker])::before, +/* overlay in the middle splits our colorview: don't style the middle */ +.cm-colorview + .cm-colorview.cm-overlay:not([data-colorpicker])::before, +/* ...and the tail */ +.cm-colorview + .cm-colorview.cm-overlay:not([data-colorpicker]) + .cm-colorview:not([data-colorpicker])::before { content: none; } diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index 7086926b..7bf179ce 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -163,6 +163,17 @@ } elements = elements || text.getElementsByClassName(OWN_DOM_CLASS); const el = elements[elementIndex++]; + while (true) { + const nextStyle = styles[i + 3]; + const nextStart = styles[i]; + if (nextStyle && nextStyle.includes(OWN_TOKEN_NAME) && + nextStart > start && nextStart <= start + data.color.length) { + elementIndex++; + i += 2; + } else { + break; + } + } if (el.colorpickerData && el.colorpickerData.color === data.color) { continue; }