Skip to content

Commit cdc402a

Browse files
We don't need to add a new part; the remove color button can be styled via the remove-button class
1 parent ade25ea commit cdc402a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/color-scale/color-scale.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const Self = class ColorScale extends ColorElement {
6464
// Update color name
6565
this.updateColorName(source.closest("color-swatch"), source.value);
6666
}
67-
else if (event.type === "click" && source.matches("[part=remove-button]")) {
67+
else if (event.type === "click" && source.matches("button.remove-button")) {
6868
// Remove color
6969
this.removeColor(source.closest("color-swatch"));
7070
}
@@ -211,7 +211,7 @@ const Self = class ColorScale extends ColorElement {
211211
this.#swatches[i] = swatch = document.createElement("color-swatch");
212212
swatch.setAttribute("size", "large");
213213
swatch.setAttribute("part", "color-swatch");
214-
swatch.setAttribute("exportparts", "swatch, info, gamut, remove-button");
214+
swatch.setAttribute("exportparts", "swatch, info, gamut");
215215
newSwatches.push(swatch);
216216
}
217217

@@ -229,7 +229,7 @@ const Self = class ColorScale extends ColorElement {
229229

230230
if (this.editable.color) {
231231
html += `<input value="${ color }" />`;
232-
html += `<button slot="swatch-content" part="remove-button" title="Remove color">❌</button>`;
232+
html += `<button slot="swatch-content" class="remove-button" title="Remove color">❌</button>`;
233233
}
234234

235235
swatch.innerHTML = html;

0 commit comments

Comments
 (0)