diff --git a/src/index.js b/src/index.js index 30bfaac..6766ed3 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,7 @@ const divStyle = { maxWidth: '100%' } -const iframeStyle = { +let iframeStyle = { position: 'absolute', top: 0, left: 0, @@ -33,6 +33,9 @@ const ratioToPercent = (ratio) => { const ResponsiveEmbed = (props) => { const paddingBottom = ratioToPercent(props.ratio) const style = Object.assign({}, divStyle, {paddingBottom}) + if (props.style) { + iframeStyle = Object.assign(iframeStyle, props.style) + } const iframeProps = Object.assign({frameBorder: 0}, props, {style: iframeStyle}) delete iframeProps.ratio return div({style},