Skip to content

Commit

Permalink
feat(iframe): add 'important' to all iframe style
Browse files Browse the repository at this point in the history
  • Loading branch information
JalilArfaoui committed Mar 1, 2019
1 parent 9217ddb commit 69b510a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/app/content/extensionIframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export const create = ({ style = {} }) => {
iframe.height = '423px';
iframe.srcdoc = '<!doctype html><html><head><meta charset="utf-8"></head><body /></html>';

Object.assign(iframe.style, style);
Object.keys(style).forEach(
key => iframe.style.setProperty(key, style[key], 'important')
);

return iframe;
};
Expand All @@ -21,4 +23,4 @@ export const append = iframe => new Promise((resolve) => {
export const remove = () => {
const el = document.getElementById('lmemFrame');
el.remove();
};
};
10 changes: 5 additions & 5 deletions src/app/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ export default {
// iframe
iframe: {
style: {
maxWidth: 'initial',
minWidth: 'initial',
minHeight: 'initial',
maxHeight: 'initial',
'max-width': 'initial',
'min-width': 'initial',
'min-height': 'initial',
'max-height': 'initial',
position: 'fixed',
top: 0,
right: 0,
zIndex: 2147483647, // Max z-index value (signed 32bits integer)
'z-index': 2147483647, // Max z-index value (signed 32bits integer)
border: 'none',
transition: 'height .1s',
width: '390px',
Expand Down

0 comments on commit 69b510a

Please sign in to comment.