mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-30 06:25:33 +01:00
Merge pull request #102 from orangemug/feature/color-swatch
Added color swatch to color field
This commit is contained in:
commit
5792a531ce
2 changed files with 14 additions and 1 deletions
|
@ -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,15 @@
|
||||||
|
|
||||||
.maputnik-color-wrapper {
|
.maputnik-color-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline;
|
|
||||||
|
@include flex-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.maputnik-color-swatch {
|
||||||
|
height: 26px;
|
||||||
|
width: 3px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ARRAY
|
// ARRAY
|
||||||
|
|
Loading…
Reference in a new issue