diff --git a/components/BackgroundSelect.js b/components/BackgroundSelect.js index 6293467..a6e9cb4 100644 --- a/components/BackgroundSelect.js +++ b/components/BackgroundSelect.js @@ -34,6 +34,18 @@ class BackgroundSelect extends React.Component { } render() { + let background = this.props.config.backgroundColor || config.backgroundColor + background = + typeof background === 'string' + ? background + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(/\//g, '/') + : background + return (
@@ -116,15 +128,7 @@ class BackgroundSelect extends React.Component { ? `background: url(${this.props.config.backgroundImage}); background-size: cover; background-repeat: no-repeat;` - : `background: ${(this.props.config.backgroundColor || config.backgroundColor) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(/\//g, '/')}; - background-size: auto; - background-repeat: repeat;`}; + : `background: ${background};`}; } .bg-color-alpha {