Skip to content

Commit 9c6e43a

Browse files
authored
Add styles override option to SketchFields
Allow optional overriding the color styles (like label color which is hardcoded to casesandberg#222) in the SketchFields from the parent component.
1 parent bc9a0e1 commit 9c6e43a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/sketch/SketchFields.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
import React from 'react'
44
import reactCSS from 'reactcss'
5+
import merge from 'lodash/merge'
56
import * as color from '../../helpers/color'
67

78
import { EditableInput } from '../common'
89

9-
export const SketchFields = ({ onChange, rgb, hsl, hex, disableAlpha }) => {
10-
const styles = reactCSS({
10+
export const SketchFields = ({ onChange, rgb, hsl, hex, disableAlpha, styles: passedStyles = {} }) => {
11+
const styles = reactCSS(merge({
1112
'default': {
1213
fields: {
1314
display: 'flex',
@@ -46,7 +47,7 @@ export const SketchFields = ({ onChange, rgb, hsl, hex, disableAlpha }) => {
4647
display: 'none',
4748
},
4849
},
49-
}, { disableAlpha })
50+
}, { disableAlpha }), passedStyles)
5051

5152
const handleChange = (data, e) => {
5253
if (data.hex) {

0 commit comments

Comments
 (0)