Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const divStyle = {
maxWidth: '100%'
}

const iframeStyle = {
let iframeStyle = {
position: 'absolute',
top: 0,
left: 0,
Expand All @@ -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},
Expand Down