bgrins / spectrum

The No Hassle JavaScript Colorpicker
https://bgrins.github.io/spectrum/
MIT License
2.32k stars 588 forks source link

Show empty button by using option allowEmpty and showPaletteOnly #473

Open rwam opened 7 years ago

rwam commented 7 years ago

If you use the option showPaletteOnly: true then there isn't an opportunity to reset the color. I've implemented a possible solution by adding another button in the palette. It looks like the screenshot below.

spectrum-empty-button

See also issues 354 and 369

FCsean commented 4 years ago

Found a bug.

.sp-container .sp-clear-palette-only {
    display: none;
}

Should be after

.sp-clear-enabled .sp-clear {
    display: block;
    position:absolute;
    top:0px;
    right:0;
    bottom:0;
    left:84%;
    height: 28px;
}