fix background rendering

main
briandennis 7 years ago committed by Brian Dennis
parent 921d6b40b2
commit 2eee0078e7

@ -74,7 +74,6 @@ class Carbon extends React.Component {
render() { render() {
const config = { ...DEFAULT_SETTINGS, ...this.props.config } const config = { ...DEFAULT_SETTINGS, ...this.props.config }
const options = { const options = {
lineNumbers: config.lineNumbers, lineNumbers: config.lineNumbers,
mode: this.state.language || 'plaintext', mode: this.state.language || 'plaintext',
@ -108,7 +107,8 @@ class Carbon extends React.Component {
options={options} options={options}
/> />
<div id="container-bg"> <div id="container-bg">
<div className="alpha" /> <div className="white eliminateOnRender" />
<div className="alpha eliminateOnRender" />
<div className="bg" /> <div className="bg" />
</div> </div>
<style jsx>{` <style jsx>{`
@ -119,6 +119,14 @@ class Carbon extends React.Component {
} }
#container #container-bg { #container #container-bg {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
#container .white {
background: #fff; background: #fff;
position: absolute; position: absolute;
top: 0px; top: 0px;

@ -101,7 +101,7 @@ class Editor extends React.Component {
transform: 'scale(2)', transform: 'scale(2)',
'transform-origin': 'center' 'transform-origin': 'center'
}, },
filter: n => n.id !== 'container-bg', filter: n => (n.className ? String(n.className).indexOf('eliminateOnRender') < 0 : true),
width: node.offsetWidth * 2, width: node.offsetWidth * 2,
height: node.offsetHeight * 2 height: node.offsetHeight * 2
} }

Loading…
Cancel
Save