mirror of
https://github.com/maputnik/editor.git
synced 2026-06-19 05:37:27 +00:00
Added color swatch to color field.
This commit is contained in:
@@ -81,8 +81,13 @@ class ColorField extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
var swatchStyle = {
|
||||||
|
"background-color": this.props.value
|
||||||
|
};
|
||||||
|
|
||||||
return <div className="maputnik-color-wrapper">
|
return <div className="maputnik-color-wrapper">
|
||||||
{this.state.pickerOpened && picker}
|
{this.state.pickerOpened && picker}
|
||||||
|
<div className="maputnik-color-swatch" style={swatchStyle}></div>
|
||||||
<input
|
<input
|
||||||
className="maputnik-color"
|
className="maputnik-color"
|
||||||
ref="colorInput"
|
ref="colorInput"
|
||||||
|
|||||||
@@ -30,7 +30,12 @@
|
|||||||
|
|
||||||
.maputnik-color-wrapper {
|
.maputnik-color-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline;
|
@include flex-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.maputnik-color-swatch {
|
||||||
|
height: 26px;
|
||||||
|
width: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ARRAY
|
// ARRAY
|
||||||
|
|||||||
Reference in New Issue
Block a user