css pseudo element
`::-moz-color-swatch` CSS pseudo-element
The ::-moz-color-swatch CSS pseudo-element is a Mozilla extension that represents the color selected in an <input> of type="color".
[!NOTE] Using
::-moz-color-swatchwith anything but an<input type="color">doesn’t match anything and has no effect.
Syntax
::-moz-color-swatch {
/* ... */
}
Examples
HTML
<input type="color" value="#de2020" />
CSS
input[type="color"]::-moz-color-swatch {
border-radius: 10px;
border-style: none;
}
Result
Interactive exampleOpen the canonical MDN source to run this embedded demo.
Specifications
Not part of any standard.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- Similar pseudo-elements used by other browsers:
::-webkit-color-swatch, pseudo-element supported by WebKit and Blink (Safari, Chrome, and Opera)