diff --git a/src/components/PreviewFrame.jsx b/src/components/PreviewFrame.jsx index 3ca26f15af..efc8abcbc6 100644 --- a/src/components/PreviewFrame.jsx +++ b/src/components/PreviewFrame.jsx @@ -7,7 +7,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import {CompiledProject as CompiledProjectRecord} from '../records'; -import bowser from '../services/bowser'; +import bowser, { innerWidth } from '../services/bowser'; import {sourceDelimiter} from '../util/compileProject'; import {createError} from '../util/errorUtils'; import retryingFailedImports from '../util/retryingFailedImports'; @@ -30,6 +30,13 @@ class PreviewFrame extends React.Component { compiledProject: {source}, } = props; + const isWindowSmall = innerWidth < 1366; + const increaseIFrameBodyFont = ``; + bindAll(this, '_attachToFrame', '_handleInfiniteLoop'); this.render = constant( @@ -39,7 +46,7 @@ class PreviewFrame extends React.Component { name={`preview-frame-${nextId++}`} ref={this._attachToFrame} sandbox={sandboxOptions} - srcDoc={source} + srcDoc={source + (isWindowSmall ? increaseIFrameBodyFont : "")} /> , ); diff --git a/src/components/ProjectPreview.jsx b/src/components/ProjectPreview.jsx index 49a7d3cd08..0ebd56c4a9 100644 --- a/src/components/ProjectPreview.jsx +++ b/src/components/ProjectPreview.jsx @@ -27,7 +27,7 @@ export default function ProjectPreview({ {preview.slice(0, MAX_LENGTH)} {!isNil(project.updatedAt) && (